forked from openhab/openhab-addons
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into zigbee-mvn
* master: (29 commits) removed background discovery code Adapted code to latest stable ESH release Improved default sitemap provider and demo files to make the Classic UI behave nice again. Also adapted AutoApproveService and removed ThingItemProvider as it was superceded by the ThingSetupManager of ESH. added info about Milight and Energenie updated information about rrd4j Implemented ItemRegistry, ItemUIRegistry and ChartProvider support for the compatibility layer. This fixes openhab#146. Added InsteonPLM 1.7 binding Format start scripts and add check for not found equinox launcher Resource leak: 'socket' never closed Fix a bug in the implementation of DiscoveryListener of the ZonePlayerHandler classpath's JRE container and execution enviroment's one does not fit Add HABmin link to dashboard Signed-off-by: Chris Jackson <[email protected]> (github: cdjackson) stop add workspace plugins automatically to launch config updated launch config for new target platform upgraded Jetty to 9.2.9 and JAX-RS connector to 4.2.2 Fixes openhab#38 Network Binding improvments -NetworkHealth renamed to Network -Retry for Mobile Devices which sometimes go to sleep -System Ping is now usable removed 2.0 alpha compat info Update compatability Add OW-Server, MySQL, Heatmiser, SNMP Signed-off-by: Chris Jackson <[email protected]> (github: cdjackson) changed comaptibility.md to reflect sucessful testing of openhab 1.6.0 bindings Fs20 and CUL on openhab2 snapshot Implementation of the playTrack functionality ... Conflicts: addons/binding/pom.xml
- Loading branch information
Showing
85 changed files
with
3,347 additions
and
903 deletions.
There are no files selected for viewing
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...rg.openhab.binding.networkhealth/.project → ...ding/org.openhab.binding.network/.project
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
6 changes: 3 additions & 3 deletions
6
...networkhealth/ESH-INF/binding/binding.xml → ...nding.network/ESH-INF/binding/binding.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 |
---|---|---|
@@ -1,11 +1,11 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<binding:binding id="networkhealth" | ||
<binding:binding id="network" | ||
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"> | ||
|
||
<name>NetworkHealth Binding</name> | ||
<description>The Network Health Binding checks if a Device is currently on the Network or not</description> | ||
<name>Network Binding</name> | ||
<description>The Network Binding checks if a Device is currently on the Network or not</description> | ||
<author>Marc Mettke</author> | ||
|
||
</binding:binding> |
23 changes: 23 additions & 0 deletions
23
addons/binding/org.openhab.binding.network/ESH-INF/i18n/network_de.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# binding | ||
binding.network.name = Network Binding | ||
binding.network.description = Das Network Binding überprüft, ob sich ein Geräte aktuell im Netzwerk befindet oder nicht. | ||
|
||
# thing types | ||
thing-type.network.device.label = Netzgerät | ||
thing-type.network.device.description = Das Netzwerkgerät muss mit dem gleichen Netzwerk verbunden sein wie OpenHAB | ||
thing-type.config.network.device.hostname.label = Hostname oder IP | ||
thing-type.config.network.device.hostname.description = Hostname oder IP des Netzwerkgerätes | ||
thing-type.config.network.device.port.label = Port | ||
thing-type.config.network.device.port.description = Der Port an dem das Gerät erreichbar ist. | ||
thing-type.config.network.device.retry.label = Wiederholen | ||
thing-type.config.network.device.retry.description = Gibt an, wie oft der PING wiederholt werden soll, bevor das Gerät als offline markiert wird. | ||
thing-type.config.network.device.timeout.label = Zeitlimit | ||
thing-type.config.network.device.timeout.description = Gibt an, wie lange maximal gewartet werden soll (in ms), bis ein Gerät als nicht vorhanden gekenntzeichnet wird. | ||
thing-type.config.network.device.refresh_interval.label = Aktualisierungsintervall | ||
thing-type.config.network.device.refresh_interval.description = Spezifiziert den Aktualisierungsintervall (in ms) | ||
thing-type.config.network.device.use_system_ping.label = System Ping | ||
thing-type.config.network.device.use_system_ping.description = Nutzt das Ping Programm des Systems | ||
|
||
# channel types | ||
channel-type.network.online.label = Online | ||
channel-type.network.online.description = Gibt an ob das Gerät aktuell Online oder Offline ist. |
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
4 changes: 2 additions & 2 deletions
4
...ealth/OSGI-INF/NetworkHealthDiscovery.xml → ...ing.network/OSGI-INF/NetworkDiscovery.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
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
File renamed without changes.
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
75 changes: 75 additions & 0 deletions
75
....network/src/main/java/org/openhab/binding/network/discovery/NetworkDiscoveryService.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,75 @@ | ||
/** | ||
* Copyright (c) 2014 openHAB UG (haftungsbeschraenkt) and others. | ||
* All rights reserved. This program and the accompanying materials | ||
* are made available under the terms of the Eclipse Public License v1.0 | ||
* which accompanies this distribution, and is available at | ||
* http://www.eclipse.org/legal/epl-v10.html | ||
*/ | ||
package org.openhab.binding.network.discovery; | ||
|
||
import static org.openhab.binding.network.NetworkBindingConstants.*; | ||
|
||
import java.util.HashMap; | ||
import java.util.Map; | ||
import java.util.Set; | ||
|
||
import org.openhab.binding.network.service.DiscoveryCallback; | ||
import org.eclipse.smarthome.core.thing.ThingTypeUID; | ||
import org.eclipse.smarthome.core.thing.ThingUID; | ||
import org.eclipse.smarthome.config.discovery.AbstractDiscoveryService; | ||
import org.eclipse.smarthome.config.discovery.DiscoveryResult; | ||
import org.eclipse.smarthome.config.discovery.DiscoveryResultBuilder; | ||
import org.openhab.binding.network.service.NetworkService; | ||
import org.slf4j.Logger; | ||
import org.slf4j.LoggerFactory; | ||
|
||
/** | ||
* The {@link NetworkDiscoveryService} is responsible for discovering devices on | ||
* the current Network. It uses every Network Interface which is connect to a Network | ||
* | ||
* @author Marc Mettke - Initial contribution | ||
*/ | ||
public class NetworkDiscoveryService extends AbstractDiscoveryService { | ||
private final Logger logger = LoggerFactory.getLogger(NetworkDiscoveryService.class); | ||
|
||
public NetworkDiscoveryService() { | ||
super(SUPPORTED_THING_TYPES_UIDS, 300, false); | ||
} | ||
|
||
public Set<ThingTypeUID> getSupportedThingTypes() { | ||
return SUPPORTED_THING_TYPES_UIDS; | ||
} | ||
|
||
@Override | ||
protected void startScan() { | ||
logger.debug("Starting Discovery"); | ||
NetworkService.discoverNetwork(new DiscoveryCallback() { | ||
@Override | ||
public void newDevice(String ip) { | ||
submitDiscoveryResults(ip); | ||
} | ||
}, scheduler); | ||
} | ||
|
||
/** | ||
* Submit the discovered Devices to the Smarthome inbox, | ||
* | ||
* @param ip The Device IP | ||
*/ | ||
private void submitDiscoveryResults(String ip) { | ||
|
||
// uid must not contains dots | ||
ThingUID uid = new ThingUID(THING_TYPE_DEVICE, ip.replace('.', '_') ); | ||
|
||
if(uid!=null) { | ||
Map<String, Object> properties = new HashMap<>(1); | ||
properties.put(PARAMETER_HOSTNAME ,ip); | ||
DiscoveryResult result = DiscoveryResultBuilder.create(uid) | ||
.withProperties(properties) | ||
.withLabel("Network Device (" + ip +")").build(); | ||
thingDiscovered(result); | ||
} | ||
|
||
} | ||
|
||
} |
Oops, something went wrong.