technologiestiftung / exhibition-remote-control

MIT License
1 stars 1 forks source link

Evaluate if the process worked? #1

Open ff6347 opened 4 years ago

ff6347 commented 4 years ago

From the docs I see that plug.setPowerState() returns a Promise <true> would be good not only to assume the plug is on, but to use the response. ;) https://github.com/technologiestiftung/exhibition-remote-control/blob/c0ee643af4ede9e8695de5715ca4a124c8399ca9/index.js#L43

jvolker commented 4 years ago

Mhhh … use it in what way? To keep track of the plugs state is something I put on the todo list for later. I don't really see a use-case at the moment. Normally if you make changes to the setup you would probably restart the server anyway.

I think this should be solid enough for now.

ff6347 commented 4 years ago

No. I mean the plug could return false and you wouldn't notice. Just normal error handling

jvolker commented 4 years ago

What would you recommend in such a case? Throw an error in the UI?

ff6347 commented 4 years ago

Yes. Since no one will watch the shell.

jvolker commented 4 years ago

But they should watch the exhibition. If something is not working they are going to complain anyway. ;)

ff6347 commented 4 years ago

But an error handler that tells you on screen "hey. exhibit foo could not start the power" is a nice feature. If this would be there the user knows that the plug didn't or did work.

IMO it helps troubleshooting the process.