forked from openhab/openhab-addons
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Olivier Marceau <[email protected]>
- Loading branch information
1 parent
fdf8ebe
commit 9744fff
Showing
16 changed files
with
1,384 additions
and
13 deletions.
There are no files selected for viewing
Validating CODEOWNERS rules …
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
# tplinkrouter Binding | ||
|
||
_Give some details about what this binding is meant for - a protocol, system, specific device._ | ||
|
||
_If possible, provide some resources like pictures (only PNG is supported currently), a video, etc. to give an impression of what can be done with this binding._ | ||
_You can place such resources into a `doc` folder next to this README.md._ | ||
|
||
_Put each sentence in a separate line to improve readability of diffs._ | ||
|
||
## Supported Things | ||
|
||
_Please describe the different supported things / devices including their ThingTypeUID within this section._ | ||
_Which different types are supported, which models were tested etc.?_ | ||
_Note that it is planned to generate some part of this based on the XML files within ```src/main/resources/OH-INF/thing``` of your binding._ | ||
|
||
- `bridge`: Short description of the Bridge, if any | ||
- `sample`: Short description of the Thing with the ThingTypeUID `sample` | ||
|
||
## Discovery | ||
|
||
_Describe the available auto-discovery features here._ | ||
_Mention for what it works and what needs to be kept in mind when using it._ | ||
|
||
## Binding Configuration | ||
|
||
_If your binding requires or supports general configuration settings, please create a folder ```cfg``` and place the configuration file ```<bindingId>.cfg``` inside it._ | ||
_In this section, you should link to this file and provide some information about the options._ | ||
_The file could e.g. look like:_ | ||
|
||
``` | ||
# Configuration for the tplinkrouter Binding | ||
# | ||
# Default secret key for the pairing of the tplinkrouter Thing. | ||
# It has to be between 10-40 (alphanumeric) characters. | ||
# This may be changed by the user for security reasons. | ||
secret=openHABSecret | ||
``` | ||
|
||
_Note that it is planned to generate some part of this based on the information that is available within ```src/main/resources/OH-INF/binding``` of your binding._ | ||
|
||
_If your binding does not offer any generic configurations, you can remove this section completely._ | ||
|
||
## Thing Configuration | ||
|
||
_Describe what is needed to manually configure a thing, either through the UI or via a thing-file._ | ||
_This should be mainly about its mandatory and optional configuration parameters._ | ||
|
||
_Note that it is planned to generate some part of this based on the XML files within ```src/main/resources/OH-INF/thing``` of your binding._ | ||
|
||
### `sample` Thing Configuration | ||
|
||
| Name | Type | Description | Default | Required | Advanced | | ||
|-----------------|---------|---------------------------------------|---------|----------|----------| | ||
| hostname | text | Hostname or IP address of the device | N/A | yes | no | | ||
| password | text | Password to access the device | N/A | yes | no | | ||
| refreshInterval | integer | Interval the device is polled in sec. | 600 | no | yes | | ||
|
||
## Channels | ||
|
||
_Here you should provide information about available channel types, what their meaning is and how they can be used._ | ||
|
||
_Note that it is planned to generate some part of this based on the XML files within ```src/main/resources/OH-INF/thing``` of your binding._ | ||
|
||
| Channel | Type | Read/Write | Description | | ||
|---------|--------|------------|-----------------------------| | ||
| control | Switch | RW | This is the control channel | | ||
|
||
## Full Example | ||
|
||
_Provide a full usage example based on textual configuration files._ | ||
_*.things, *.items examples are mandatory as textual configuration is well used by many users._ | ||
_*.sitemap examples are optional._ | ||
|
||
## Any custom content here! | ||
|
||
_Feel free to add additional sections for whatever you think should also be mentioned about your binding!_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<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 https://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>3.3.0-SNAPSHOT</version> | ||
</parent> | ||
|
||
<artifactId>org.openhab.binding.tplinkrouter</artifactId> | ||
|
||
<name>openHAB Add-ons :: Bundles :: TpLinkRouter Binding</name> | ||
|
||
</project> |
9 changes: 9 additions & 0 deletions
9
bundles/org.openhab.binding.tplinkrouter/src/main/feature/feature.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<features name="org.openhab.binding.tplinkrouter-${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-tplinkrouter" description="TpLinkRouter Binding" version="${project.version}"> | ||
<feature>openhab-runtime-base</feature> | ||
<bundle start-level="80">mvn:org.openhab.addons.bundles/org.openhab.binding.tplinkrouter/${project.version}</bundle> | ||
</feature> | ||
</features> |
39 changes: 39 additions & 0 deletions
39
...src/main/java/org/openhab/binding/tplinkrouter/internal/TpLinkRouterBindingConstants.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/** | ||
* Copyright (c) 2010-2022 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.openhab.binding.tplinkrouter.internal; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
import org.openhab.core.thing.ThingTypeUID; | ||
|
||
/** | ||
* The {@link TpLinkRouterBindingConstants} class defines common constants, which are | ||
* used across the whole binding. | ||
* | ||
* @author Olivier Marceau - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public class TpLinkRouterBindingConstants { | ||
|
||
private static final String BINDING_ID = "tplinkrouter"; | ||
|
||
// List of all Thing Type UIDs | ||
public static final ThingTypeUID THING_TYPE_TDW9970 = new ThingTypeUID(BINDING_ID, "TD-W9970"); | ||
|
||
// List of all Channel ids | ||
public static final String WIFI_STATUS = "wifi#Status"; | ||
public static final String WIFI_SSID = "wifi#SSID"; | ||
public static final String WIFI_BANDWIDTH = "wifi#bandWidth"; | ||
public static final String WIFI_QSS = "wifi#QSS"; | ||
public static final String WIFI_SECMODE = "wifi#SecMode"; | ||
public static final String WIFI_KEY = "wifi#Key"; | ||
} |
33 changes: 33 additions & 0 deletions
33
...er/src/main/java/org/openhab/binding/tplinkrouter/internal/TpLinkRouterConfiguration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* Copyright (c) 2010-2022 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.openhab.binding.tplinkrouter.internal; | ||
|
||
import org.eclipse.jdt.annotation.NonNullByDefault; | ||
|
||
/** | ||
* The {@link TpLinkRouterConfiguration} class contains fields mapping thing configuration parameters. | ||
* | ||
* @author Olivier Marceau - Initial contribution | ||
*/ | ||
@NonNullByDefault | ||
public class TpLinkRouterConfiguration { | ||
|
||
/** | ||
* Sample configuration parameters. Replace with your own. | ||
*/ | ||
public String hostname = ""; | ||
public int port = 23; | ||
public String username = ""; | ||
public String password = ""; | ||
public int refreshInterval = 600; | ||
} |
Oops, something went wrong.