Skip to content
This repository has been archived by the owner on Apr 25, 2021. It is now read-only.

Report HC2 Unresponsive/dead accessories #148

Open
lboue opened this issue Apr 25, 2019 · 3 comments
Open

Report HC2 Unresponsive/dead accessories #148

lboue opened this issue Apr 25, 2019 · 3 comments

Comments

@lboue
Copy link
Contributor

lboue commented Apr 25, 2019

Hello,

I would report unresponsive accessories to HomeKit app. For exemple if device is not powered on, the HC2 REST API reports is as dead: dead: "true",

I found explanations here on the HAP-NodeJS github Change updateValue to return not responding status #556

Explanations

We can init an err variable and then trigger an error

    var err = null; // in case there were any problems
    ...
    err = new Error("Polling failed");

Or use a boolean like the dead attribute:

    var err = null; // in case there were any problems
    var isAccReachable = false;  // Set Reachability
    isAccReachable ? err = null : err = new Error("Polling failed");

Fake Outlet hap-nodejs test

I did a test with hap-nodejs et that file:
Outlet_accessory.js.
If I change isAccReachable to true, the Outlet become reachable withHomeKit

pi@raspberrypi:/usr/lib/node_modules/homebridge/node_modules/hap-nodejs $ sudo nodejs Core.js 
HAP-NodeJS starting...
Are we on? No.
Are we on? No.
Are we on? No.

IMG_2153

Do you think it could be implemented? I can help for testing.

Regards

@ilcato
Copy link
Owner

ilcato commented Apr 26, 2019

It's in my to do list.

@lboue
Copy link
Contributor Author

lboue commented Nov 11, 2019

Hello @ilcato.

You can try with my test file here:
https://github.com/lboue/HAP-NodeJS/blob/no_response/accessories/Light_accessory.js

Did you had time to work on this?

@ilcato
Copy link
Owner

ilcato commented Nov 11, 2019

Very busy at the moment...

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants