From 4c11674ea8d1f80210d9cfa42db68e179b9fb047 Mon Sep 17 00:00:00 2001 From: lucatk Date: Tue, 6 Aug 2024 01:13:22 +0200 Subject: [PATCH] fix deviceId comparison to always ignore case --- src/shellies.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/shellies.ts b/src/shellies.ts index 2459ad7d..405f02e6 100644 --- a/src/shellies.ts +++ b/src/shellies.ts @@ -345,7 +345,7 @@ export class Shellies extends EventEmitter { const info = await rpcHandler.request('Shelly.GetDeviceInfo'); // make sure the returned device ID matches - if (info.id !== deviceId) { + if (info.id.toLowerCase() !== deviceId.toLowerCase()) { throw new Error(`Unexpected device ID (returned: ${info.id}, expected: ${deviceId})`); } @@ -392,4 +392,4 @@ export class Shellies extends EventEmitter { this.emit('error', deviceId, error); } } -} \ No newline at end of file +}