mirror of
https://github.com/koush/scrypted.git
synced 2026-02-16 03:32:15 +00:00
homekit: add support for notification toggle switches
This commit is contained in:
4
plugins/homekit/package-lock.json
generated
4
plugins/homekit/package-lock.json
generated
@@ -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",
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -12,3 +12,4 @@ import './switch';
|
||||
import './thermostat';
|
||||
import './vacuum';
|
||||
import './outlet';
|
||||
import './notifier';
|
||||
|
||||
14
plugins/homekit/src/types/notifier.ts
Normal file
14
plugins/homekit/src/types/notifier.ts
Normal 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;
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user