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>
Signed-off-by: Ciprian Pascu <contact@ciprianpascu.ro>
  • Loading branch information
andrewfg authored and Ciprian Pascu committed Jan 2, 2025
1 parent 287afde commit 3d9023c
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 3d9023c

Please sign in to comment.