Skip to content

Commit

Permalink
[hueemulation] Fixes HueEmulation DiscoveryIp not used (openhab#7411)
Browse files Browse the repository at this point in the history
* Fixes HueEmulation DiscoveryIp not used

Signed-off-by: Thomas Felix <thomas.felix@tfelix.de>
  • Loading branch information
tfelix authored and J-N-K committed Jul 14, 2020
1 parent ea25825 commit 712c446
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion bundles/org.openhab.io.hueemulation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ This option allows you to override what addresses are used for the announcement.
You can have multiple comma separated entries.

```
org.openhab.hueemulation:discoveryIps=192.168.1.100,::FFFF:A9DB:0D85
org.openhab.hueemulation:discoveryIp=192.168.1.100,::FFFF:A9DB:0D85
```

The hue emulation service supports three types of emulated bulbs.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,8 +193,8 @@ public void modified(Map<String, Object> properties) {
InetAddress configuredAddress = null;
int networkPrefixLength = 24; // Default for most networks: 255.255.255.0

if (config.discoveryIps != null) {
discoveryIps = Collections.unmodifiableSet(Stream.of(config.discoveryIps.split(",")).map(String::trim)
if (config.discoveryIp != null) {
discoveryIps = Collections.unmodifiableSet(Stream.of(config.discoveryIp.split(",")).map(String::trim)
.map(this::byName).filter(e -> e != null).collect(Collectors.toSet()));
} else {
discoveryIps = new LinkedHashSet<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,11 @@ public class HueEmulationConfig {

/** Pairing timeout in seconds */
public int pairingTimeout = 60;
public @Nullable String discoveryIps;
/**
* The field discoveryIps was named discoveryIp in the frontend for some time and thus user probably
* have it in their local config saved under the non plural version.
*/
public @Nullable String discoveryIp;
public int discoveryHttpPort = 0;
/** Comma separated list of tags */
public String restrictToTagsSwitches = "Switchable";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
</parameter>
<parameter name="discoveryIp" type="text" required="false">
<label>Optional Discovery Address</label>
<description>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.</description>
<description>If your host has multiple IP addresses you may specify the IP(s) you would like to advertise in the UPNP discovery process. You may safely leave this empty on most systems. Use commas to separate multiple entries.</description>
</parameter>
<parameter name="discoveryHttpPort" type="integer" required="false">
<label>Optional Discovery Web Port</label>
Expand Down

0 comments on commit 712c446

Please sign in to comment.