From 4672bb061de8fe40d4f000b5e640a89289824dfa Mon Sep 17 00:00:00 2001 From: Simon Spielmann Date: Thu, 30 Mar 2023 08:26:35 +0200 Subject: [PATCH] Fix usage of device name Signed-off-by: Simon Spielmann --- .../icloud/internal/handler/ICloudDeviceHandler.java | 2 +- .../test/java/org/openhab/binding/icloud/TestICloud.java | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/handler/ICloudDeviceHandler.java b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/handler/ICloudDeviceHandler.java index ad8e854eed947..b3d2190a44f92 100644 --- a/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/handler/ICloudDeviceHandler.java +++ b/bundles/org.openhab.binding.icloud/src/main/java/org/openhab/binding/icloud/internal/handler/ICloudDeviceHandler.java @@ -188,7 +188,7 @@ private void updateLocationRelatedStates(ICloudDeviceInformation deviceInformati String currentId = deviceInformationRecord.getDeviceDiscoveryId(); if (currentId == null || "".equals(currentId)) { logger.debug("deviceDiscoveryId is empty, using device name for identification."); - currentId = deviceInformationRecord.getDeviceDisplayName(); + currentId = deviceInformationRecord.getName(); } logger.debug("Current data element: [id = {}]", currentId); diff --git a/bundles/org.openhab.binding.icloud/src/test/java/org/openhab/binding/icloud/TestICloud.java b/bundles/org.openhab.binding.icloud/src/test/java/org/openhab/binding/icloud/TestICloud.java index 1297f324382af..92ca8f43cf314 100644 --- a/bundles/org.openhab.binding.icloud/src/test/java/org/openhab/binding/icloud/TestICloud.java +++ b/bundles/org.openhab.binding.icloud/src/test/java/org/openhab/binding/icloud/TestICloud.java @@ -241,7 +241,7 @@ public void testDiscovery() { "scdPh": "", "locationCapable": true, "trackingInfo": null, - "name": "Simon iPad", + "name": "My iPad", "isMac": false, "thisDevice": false, "deviceClass": "iPad", @@ -344,7 +344,7 @@ public void testDiscovery() { "scdPh": "", "locationCapable": true, "trackingInfo": null, - "name": "Simon iPad", + "name": "iPad Air without ID", "isMac": false, "thisDevice": false, "deviceClass": "iPad", @@ -370,7 +370,7 @@ public void testDiscovery() { "locFoundEnabled": false, "snd": null, "lostDevice": null, - "deviceDisplayName": "iPad Air without ID", + "deviceDisplayName": "iPad", "prsId": null, "audioChannels": [