Skip to content

Commit 11326e7

Browse files
authored
[sonyprojector] fix mac address (openhab#16972)
Signed-off-by: Andrew Fiddian-Green <[email protected]>
1 parent 104a71b commit 11326e7

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

bundles/org.openhab.binding.sonyprojector/src/main/java/org/openhab/binding/sonyprojector/internal/communication/sdcp/SonyProjectorSdcpConnector.java

+9-1
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,14 @@ public String getModelName() throws SonyProjectorException {
320320
* @throws SonyProjectorException in case of any problem
321321
*/
322322
public String getMacAddress() throws SonyProjectorException {
323-
return new String(getSetting(SonyProjectorItem.MAC_ADDRESS), StandardCharsets.UTF_8);
323+
String macAddress = "";
324+
byte[] macBytes = getSetting(SonyProjectorItem.MAC_ADDRESS);
325+
for (byte macByte : macBytes) {
326+
if (!macAddress.isEmpty()) {
327+
macAddress = macAddress + "-";
328+
}
329+
macAddress = macAddress + Integer.toHexString(macByte);
330+
}
331+
return macAddress.toLowerCase();
324332
}
325333
}

0 commit comments

Comments
 (0)