[sonyprojector] fix mac address (#16972)

Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
This commit is contained in:
Andrew Fiddian-Green 2024-07-01 12:31:35 +01:00 committed by GitHub
parent 104a71b663
commit 11326e7b77
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -320,6 +320,14 @@ public class SonyProjectorSdcpConnector extends SonyProjectorConnector {
* @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();
}
}