Skip to content

Commit

Permalink
homekit: merge child device only if child has homekit enabled (#1343)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjia56 authored Mar 3, 2024
1 parent e2067c1 commit 644f7d3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion plugins/homekit/src/types/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 644f7d3

Please sign in to comment.