From 1cbb44f7143bfec41e0be548f91ce187128a81c4 Mon Sep 17 00:00:00 2001 From: Ziver Koc Date: Mon, 30 Aug 2021 01:46:39 +0200 Subject: [PATCH] Fixed casting issue --- .../src/se/hal/plugin/assistant/google/SmartHomeImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/hal-assistant-google/src/se/hal/plugin/assistant/google/SmartHomeImpl.java b/plugins/hal-assistant-google/src/se/hal/plugin/assistant/google/SmartHomeImpl.java index c02d3710..36083efb 100644 --- a/plugins/hal-assistant-google/src/se/hal/plugin/assistant/google/SmartHomeImpl.java +++ b/plugins/hal-assistant-google/src/se/hal/plugin/assistant/google/SmartHomeImpl.java @@ -186,7 +186,7 @@ public class SmartHomeImpl extends SmartHomeApp implements TokenRegistrationList throw new IllegalArgumentException("Device Type and ID was no supplied in customData: " + deviceRequest.getId()); String deviceTypeStr = (String) deviceRequest.getCustomData().get("type"); - long deviceId = Long.parseLong((String) deviceRequest.getCustomData().get("id")); + long deviceId = (Long) deviceRequest.getCustomData().get("id"); HalAbstractDevice device; switch (deviceTypeStr) { @@ -241,7 +241,7 @@ public class SmartHomeImpl extends SmartHomeApp implements TokenRegistrationList throw new IllegalArgumentException("Device Type and ID was no supplied in customData: " + deviceRequest.getId()); String deviceTypeStr = (String) deviceRequest.getCustomData().get("type"); - long deviceId = Long.parseLong((String) deviceRequest.getCustomData().get("id")); + long deviceId = (Long) deviceRequest.getCustomData().get("id"); HalAbstractDevice device; switch (deviceTypeStr) {