forked from J-N-K/openhab-addons
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[miele] Fix multicast and multi-protocol support (ZigBee/Wi-Fi) (open…
…hab#11244) * Fix multicast and multi-protocol support (ZigBee/Wi-Fi) * Fix channel description referring to hood but also used for oven and other appliances. * Fix auto-discovery finding already configured things through files. Fixes openhab#11242 Fixes openhab#11243 Signed-off-by: Jacob Laursen <[email protected]>
- Loading branch information
1 parent
54ea293
commit 7c34ffb
Showing
27 changed files
with
390 additions
and
147 deletions.
There are no files selected for viewing
64 changes: 64 additions & 0 deletions
64
...e/src/main/java/org/openhab/binding/miele/internal/FullyQualifiedApplianceIdentifier.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,64 @@ | ||
/** | ||
* Copyright (c) 2010-2021 Contributors to the openHAB project | ||
* | ||
* See the NOTICE file(s) distributed with this work for additional | ||
* information. | ||
* | ||
* This program and the accompanying materials are made available under the | ||
* terms of the Eclipse Public License 2.0 which is available at | ||
* http://www.eclipse.org/legal/epl-2.0 | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
*/ | ||
package org.openhab.binding.miele.internal; | ||
|
||
/** | ||
* The {@link FullyQualifiedApplianceIdentifier} class represents a fully qualified appliance identifier. | ||
* Example: "hdm:ZigBee:0123456789abcdef#210" | ||
* | ||
* @author Jacob Laursen - Fixed multicast and protocol support (ZigBee/LAN) | ||
*/ | ||
public class FullyQualifiedApplianceIdentifier { | ||
private String uid; | ||
private String protocol; | ||
private String applianceId; | ||
|
||
public FullyQualifiedApplianceIdentifier(String uid) { | ||
this.uid = uid; | ||
|
||
int separatorPosition = this.uid.lastIndexOf(':') + 1; | ||
this.protocol = uid.substring(0, separatorPosition); | ||
this.applianceId = uid.substring(separatorPosition); | ||
} | ||
|
||
public FullyQualifiedApplianceIdentifier(String applianceId, String protocol) { | ||
this.uid = protocol + applianceId; | ||
this.protocol = protocol; | ||
this.applianceId = applianceId; | ||
} | ||
|
||
/** | ||
* @return UID of appliance (e.g. "hdm:ZigBee:0123456789abcdef#210") | ||
*/ | ||
public String getUid() { | ||
return this.uid; | ||
} | ||
|
||
/** | ||
* @return Appliance ID without protocol adapter information (e.g. "0123456789abcdef#210") | ||
*/ | ||
public String getApplianceId() { | ||
return this.applianceId; | ||
} | ||
|
||
public String getId() { | ||
return this.getApplianceId().replaceAll("[^a-zA-Z0-9_]", "_"); | ||
} | ||
|
||
/** | ||
* @return Protocol prefix of fully qualified appliance identifier (e.g. "hdmi:ZigBee:"") | ||
*/ | ||
public String getProtocol() { | ||
return this.protocol; | ||
} | ||
} |
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
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
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
Oops, something went wrong.