hap-java / HAP-Java

Java implementation of the HomeKit Accessory Protocol
MIT License
153 stars 82 forks source link

Question - publishing #35

Closed Phreak87 closed 7 years ago

Phreak87 commented 7 years ago

Hello,

How can I push a changed value to the client? Let's say we have a switch and I change the internal Value from true to false. How does the client update its own status ? Is it always a get -> response or can I push the new value directly via a open channel via notify client. How do I do this if this is possible ?

andylintner commented 7 years ago

Many of the characteristics support a subscription mechanism. A client that's interested in receiving pushed updates sends a subscription request. You then call the callback passed to the subscribe* method when the value changes.