These changes makes sure that characteristics comply with the HomeKit protocol when a characteristic's ValueRequestFunc returns an error. This would fix issue #30.
Changes:
GET /accessories must produce a valid "value" in the JSON, even if an error is returned
a Multi-Status 207 Response must explicitly contain "status": 0 for successful reads, when there are mixed statuses
One thing to note that deviates from the preliminary patch in #30 is that the Value must be tri-state to allow for it to:
contains a value
be omitted completely
and also to be null
So I re-used a pattern that was already in the code, using the V struct. A null value is required because the ProgrammableSwitchEvent needs to read as null, and the test was failing. I also realized that /identify must not emit a value at all.
These changes makes sure that characteristics comply with the HomeKit protocol when a characteristic's
ValueRequestFunc
returns an error. This would fix issue #30.Changes:
GET /accessories
must produce a valid"value"
in the JSON, even if an error is returned"status": 0
for successful reads, when there are mixed statusesOne thing to note that deviates from the preliminary patch in #30 is that the
Value
must be tri-state to allow for it to:null
So I re-used a pattern that was already in the code, using the
V
struct. Anull
value is required because theProgrammableSwitchEvent
needs to read asnull
, and the test was failing. I also realized that/identify
must not emit a value at all.Also added tests for the changes.