mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
add listen to network changes switch
Signed-off-by: Eugen Freiter <freiter@gmx.de>
This commit is contained in:
parent
d253e2cd2e
commit
05365effeb
@ -96,6 +96,7 @@ org.openhab.homekit:blockUserDeletion=false
|
||||
org.openhab.homekit:name=openHAB
|
||||
org.openhab.homekit:instances=1
|
||||
org.openhab.homekit:useDummyAccessories=false
|
||||
org.openhab.homekit:listenToNetworkChanges=true
|
||||
```
|
||||
|
||||
Some settings are only visible in UI if the checkbox "Show advanced" is activated.
|
||||
@ -103,7 +104,7 @@ Some settings are only visible in UI if the checkbox "Show advanced" is activate
|
||||
### Overview of all settings
|
||||
|
||||
| Setting | Description | Default value |
|
||||
|:-------------------------|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:---------------------|
|
||||
|:--------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|:--------------|
|
||||
| networkInterface | IP address or domain name under which the HomeKit bridge can be reached. If no value is configured, the add-on uses the primary IP address configured for openHAB. If unsure, keep it empty | (none) |
|
||||
| port | Port under which the HomeKit bridge can be reached. | 9123 |
|
||||
| useOHmDNS | mDNS service is used to advertise openHAB as HomeKit bridge in the network so that HomeKit clients can find it. openHAB has already mDNS service running. This option defines whether the mDNS service of openHAB or a separate service should be used. | false |
|
||||
@ -113,6 +114,7 @@ Some settings are only visible in UI if the checkbox "Show advanced" is activate
|
||||
| name | Name under which this HomeKit bridge is announced on the network. This is also the name displayed on the iOS device when searching for available bridges. | openHAB |
|
||||
| instances | Defines how many bridges to expose. Necessary if you have more than 149 accessories. Accessories must be assigned to additional instances via metadata. Additional bridges will use incrementing port numbers. | 1 |
|
||||
| useDummyAccessories | When an accessory is missing, substitute a dummy in its place instead of removing it. See [Dummy Accessories](#dummy-accessories). | false |
|
||||
| listenToNetworkChanges | Listen to network changes, e.g. changes of IP addresses, and restart HomeKit bridge. Disable in case of connectivity issues with HomeKit bridge. | true |
|
||||
|
||||
## Item Configuration
|
||||
|
||||
|
@ -412,10 +412,10 @@ public class HomekitImpl implements Homekit, NetworkAddressChangeListener, Ready
|
||||
|
||||
@Override
|
||||
public synchronized void onChanged(final List<CidrAddress> added, final List<CidrAddress> removed) {
|
||||
logger.trace("HomeKit bridge reacting on network interface changes.");
|
||||
if (!started) {
|
||||
if (!started || !settings.listenToNetworkChanges) {
|
||||
return;
|
||||
}
|
||||
logger.trace("HomeKit bridge reacting on network interface changes.");
|
||||
removed.forEach(i -> {
|
||||
logger.trace("removed interface {}", i.getAddress().toString());
|
||||
if (i.getAddress().equals(networkInterface)) {
|
||||
|
@ -34,6 +34,7 @@ public class HomekitSettings {
|
||||
public boolean useFahrenheitTemperature = false;
|
||||
public boolean useOHmDNS = false;
|
||||
public boolean blockUserDeletion = false;
|
||||
public boolean listenToNetworkChanges = true;
|
||||
public String networkInterface;
|
||||
|
||||
@Override
|
||||
@ -69,6 +70,8 @@ public class HomekitSettings {
|
||||
return false;
|
||||
} else if (!blockUserDeletion != other.blockUserDeletion) {
|
||||
return false;
|
||||
} else if (!listenToNetworkChanges != other.listenToNetworkChanges) {
|
||||
return false;
|
||||
} else if (!pin.equals(other.pin)) {
|
||||
return false;
|
||||
} else if (!setupId.equals(other.setupId)) {
|
||||
|
@ -81,5 +81,11 @@
|
||||
<default>false</default>
|
||||
<advanced>true</advanced>
|
||||
</parameter>
|
||||
<parameter name="listenToNetworkChanges" type="boolean" required="false" groupName="core">
|
||||
<label>Listen to network changes</label>
|
||||
<description>Listen to changes on the network interface, e.g. changing of IP address, and restart HomeKit bridge.</description>
|
||||
<default>true</default>
|
||||
<advanced>true</advanced>
|
||||
</parameter>
|
||||
</config-description>
|
||||
</config-description:config-descriptions>
|
||||
|
@ -30,3 +30,5 @@ io.config.homekit.useFahrenheitTemperature.label = Use Fahrenheit Temperature
|
||||
io.config.homekit.useFahrenheitTemperature.description = Defines whether or not to direct HomeKit clients to use fahrenheit temperatures instead of celsius.
|
||||
io.config.homekit.useOHmDNS.label = Use openHAB mDNS service
|
||||
io.config.homekit.useOHmDNS.description = Defines whether mDNS service of openHAB or a separate instance of mDNS should be used.
|
||||
io.config.homekit.listenToNetworkChanges.label = Listen to network changes
|
||||
io.config.homekit.listenToNetworkChanges.description = Listen to changes on the network interface, e.g. changing of IP address, and restart HomeKit bridge.
|
Loading…
Reference in New Issue
Block a user