From 8e4ba84abe15181b9c8503d01cea4baa9a700508 Mon Sep 17 00:00:00 2001 From: TheMisfit68 Date: Mon, 18 Dec 2023 20:38:10 +0100 Subject: [PATCH] added custom accessory for StatelessProgrammableSwitch --- .../StatelessProgrammableSwitch.swift | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/HAP Extensions/Custom Accessories/StatelessProgrammableSwitch.swift b/HAP Extensions/Custom Accessories/StatelessProgrammableSwitch.swift index e64469a2..a21f786b 100644 --- a/HAP Extensions/Custom Accessories/StatelessProgrammableSwitch.swift +++ b/HAP Extensions/Custom Accessories/StatelessProgrammableSwitch.swift @@ -8,14 +8,16 @@ import Foundation import HAP -#warning("TODO") // TODO: - Create a pull request to get this implemented by HAP itself -extension HAP.Accessory { - open class ProgrammableSwitch: Accessory { - public let primaryService:Service.StatelessProgrammableSwitch = Service.StatelessProgrammableSwitch() +#warning("TODO") // TODO: - Create a pull request to get this implemented into HAP itself +extension Accessory { + + open class StatelessProgrammableSwitch: Accessory { + public let primaryService:Service.StatelessProgrammableSwitch = Service.StatelessProgrammableSwitch(characteristics: [.name(String(localized: "Function key",table: "ServiceNames"))]) public init(info: Service.Info, additionalServices: [Service] = []) { super.init(info: info, type: .programmableSwitch, services: [primaryService] + additionalServices) } } + }