Skip to content

Commit

Permalink
[sonyprojector] fix mac address (openhab#16972)
Browse files Browse the repository at this point in the history
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
  • Loading branch information
andrewfg authored and joni1993 committed Oct 15, 2024
1 parent 14fe7ea commit 2556392
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,14 @@ public String getModelName() throws SonyProjectorException {
* @throws SonyProjectorException in case of any problem
*/
public String getMacAddress() throws SonyProjectorException {
return new String(getSetting(SonyProjectorItem.MAC_ADDRESS), StandardCharsets.UTF_8);
String macAddress = "";
byte[] macBytes = getSetting(SonyProjectorItem.MAC_ADDRESS);
for (byte macByte : macBytes) {
if (!macAddress.isEmpty()) {
macAddress = macAddress + "-";
}
macAddress = macAddress + Integer.toHexString(macByte);
}
return macAddress.toLowerCase();
}
}

0 comments on commit 2556392

Please sign in to comment.