homekit: add support for notification toggle switches

This commit is contained in:
Koushik Dutta
2023-02-21 08:57:54 -08:00
parent 74f4bdd429
commit d140fcfcad
4 changed files with 18 additions and 3 deletions

View File

@@ -1,12 +1,12 @@
{
"name": "@scrypted/homekit",
"version": "1.2.8",
"version": "1.2.11",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "@scrypted/homekit",
"version": "1.2.8",
"version": "1.2.11",
"dependencies": {
"@koush/werift-src": "file:../../external/werift",
"check-disk-space": "^3.3.0",

View File

@@ -1,6 +1,6 @@
{
"name": "@scrypted/homekit",
"version": "1.2.8",
"version": "1.2.11",
"description": "HomeKit Plugin for Scrypted",
"scripts": {
"scrypted-setup-project": "scrypted-setup-project",

View File

@@ -12,3 +12,4 @@ import './switch';
import './thermostat';
import './vacuum';
import './outlet';
import './notifier';

View File

@@ -0,0 +1,14 @@
import { OnOff, ScryptedDevice, ScryptedDeviceType } from '@scrypted/sdk';
import { addSupportedType, } from '../common';
import { Service } from '../hap';
import { getAccessory, probe } from './onoff-base';
import type { HomeKitPlugin } from "../main";
addSupportedType({
type: ScryptedDeviceType.Notifier,
probe,
getAccessory: async (device: ScryptedDevice & OnOff, homekitPlugin: HomeKitPlugin) => {
const {accessory, service} = getAccessory(device, homekitPlugin, Service.Switch);
return accessory;
}
});