-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Getting Started? #167
Comments
There is a Delegate protocol for Accessory. So, if one of your types conforms to that protocol, you can set it as a delegate of an accessory. Then implement Which will be called when a characteristic changes on that accessory. |
Thank you! Super helpful!
Thanks,
Dave
On Feb 13, 2025, at 11:50 PM, Diggory Laycock ***@***.***> wrote:
There is a Delegate protocol<https://github.com/Bouke/HAP/blob/master/Sources/HAP/Base/AccessoryDelegate.swift> for Accessory.
So, if one of your types conforms to that protocol, you can set it as a delegate of an accessory.
Then implement characteristic(_ characteristic: GenericCharacteristic<T>, ofService: Service, ofAccessory: Accessory, didChangeValue: T?) { }
Which will be called when a characteristic changes on that accessory.
—
Reply to this email directly, view it on GitHub<#167 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABLWQCVL6EN2VEBUWZWYQOD2PWN5FAVCNFSM6AAAAABXDSAY3OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNJYGUYTIMJUGQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
[Diggory]Diggory left a comment (Bouke/HAP#167)<#167 (comment)>
There is a Delegate protocol<https://github.com/Bouke/HAP/blob/master/Sources/HAP/Base/AccessoryDelegate.swift> for Accessory.
So, if one of your types conforms to that protocol, you can set it as a delegate of an accessory.
Then implement characteristic(_ characteristic: GenericCharacteristic<T>, ofService: Service, ofAccessory: Accessory, didChangeValue: T?) { }
Which will be called when a characteristic changes on that accessory.
—
Reply to this email directly, view it on GitHub<#167 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/ABLWQCVL6EN2VEBUWZWYQOD2PWN5FAVCNFSM6AAAAABXDSAY3OVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDMNJYGUYTIMJUGQ>.
You are receiving this because you authored the thread.Message ID: ***@***.***>
|
This project is helpful to get you going too: https://github.com/Bouke/My-Home/tree/master/Sources |
First, let me say. Wow! This is AWESOME. Exactly what I need.
I'm hoping someone here maybe Bouke Haarsma can provide an example of how to respond to an event when a light gets switched on/off or whatever.
I can't seem to figure out where to put the code for event handling.
help?
The text was updated successfully, but these errors were encountered: