From 644f7d33047dbbe286d6fb10d54eec68bdff626c Mon Sep 17 00:00:00 2001 From: Brett Jia Date: Sun, 3 Mar 2024 12:46:13 -0500 Subject: [PATCH] homekit: merge child device only if child has homekit enabled (#1343) --- plugins/homekit/src/types/common.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/homekit/src/types/common.ts b/plugins/homekit/src/types/common.ts index bea10e0bf..a000f4ead 100644 --- a/plugins/homekit/src/types/common.ts +++ b/plugins/homekit/src/types/common.ts @@ -3,6 +3,7 @@ import { bindCharacteristic } from "../common"; import { Accessory, Characteristic, CharacteristicEventTypes, Service, uuid } from '../hap'; import type { HomeKitPlugin } from "../main"; import { getService as getOnOffService } from "./onoff-base"; +import { HOMEKIT_MIXIN } from "../homekit-mixin"; const { deviceManager, systemManager } = sdk; @@ -201,7 +202,7 @@ export function mergeOnOffDevicesByType(device: ScryptedDevice & DeviceProvider, const children = getChildDevices(device); const mergedDevices = []; const services = children.map((child: ScryptedDevice & OnOff) => { - if (child.type !== type || !child.interfaces.includes(ScryptedInterface.OnOff)) + if (child.type !== type || !child.interfaces.includes(ScryptedInterface.OnOff) || !child.interfaces.includes(HOMEKIT_MIXIN)) return undefined; const onOffService = getOnOffService(child, accessory, Service.Switch)