mirror of
https://github.com/openhab/openhab-addons.git
synced 2025-01-10 15:11:59 +01:00
[sonyprojector] fix mac address (#16972)
Signed-off-by: Andrew Fiddian-Green <software@whitebear.ch>
This commit is contained in:
parent
104a71b663
commit
11326e7b77
@ -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();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user