Skip to content

Silly question about sensor value update #49

@UniversalMailer

Description

@UniversalMailer

Hi,
I'm trying to create a simple temperature sensor with your Homekit HAP but I'm not sure I fully understood the architecture: looking at Accessory.cpp it's pretty straightforward that the callback 'valueChangeFunctionCall' is invoked when the controller sets a new value for the characteristics but it's not clear (at least to me) what is the sibling 'read' callback.

The question is: is there a callback that is called whenever the controller asks for the current state? In the temperature example, I would like to return the current temperature (based on a call to an http server or whatever) but I wasn't able to do so.
I tried extending an intCharacteristics to my custom characteristics that override the constructor, value() and setValue() methods, to no avail: 'value()' is never changed...

Any hint on this?

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions