From e73e944073efbd2d0a65a689fdd4e54cdc06be56 Mon Sep 17 00:00:00 2001 From: Slava Mankivski Date: Sat, 26 Jun 2021 14:27:06 -0500 Subject: [PATCH] Added fskg category --- index.js | 1 + lib/fanv2_accessory.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 6cddaae3..26e3f912 100644 --- a/index.js +++ b/index.js @@ -141,6 +141,7 @@ class TuyaPlatform { this.deviceAccessories.set(uuid, deviceAccessory); break; case 'fs': + case 'fskg': deviceAccessory = new Fanv2Accessory(this, homebridgeAccessory, device); this.accessories.set(uuid, deviceAccessory.homebridgeAccessory); this.deviceAccessories.set(uuid, deviceAccessory); diff --git a/lib/fanv2_accessory.js b/lib/fanv2_accessory.js index b8c01c0d..86968f6f 100644 --- a/lib/fanv2_accessory.js +++ b/lib/fanv2_accessory.js @@ -41,7 +41,7 @@ class Fanv2Accessory extends BaseAccessory { refreshAccessoryServiceIfNeed(statusArr, isRefresh) { this.isRefresh = isRefresh for (var statusMap of statusArr) { - if (statusMap.code === 'switch') { + if (statusMap.code === 'switch' || statusMap.code === 'fan_switch') { this.switchMap = statusMap var rawStatus = this.switchMap.value let status @@ -161,7 +161,7 @@ class Fanv2Accessory extends BaseAccessory { value = false } const isOn = value; - code = "switch"; + code = this.switchMap.code; value = isOn; break; case Characteristic.TargetFanState: