ewilken / hap-rs

Rust implementation of the Apple HomeKit Accessory Protocol (HAP)
Apache License 2.0
196 stars 33 forks source link

Update examples to properly reflect target states #54

Open ewilken opened 3 years ago

ewilken commented 3 years ago

Some services have current and target versions of characteristics. Controller set the target value and expect the current value to update accordingly. Otherwise the controller might assume the accessory being unresponsive.

With this implementation, this behavior has to be implemented explicitly by a consumer of the library:

  1. Set an on_update callback to the target value.
  2. In it, update the current value to the target value the controller expects.

Accessory examples that might need this treatment: