Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enhancement: Add isOn() isOff() #24

Closed
VonOx opened this issue Aug 24, 2018 · 4 comments · Fixed by #25
Closed

Enhancement: Add isOn() isOff() #24

VonOx opened this issue Aug 24, 2018 · 4 comments · Fixed by #25

Comments

@VonOx
Copy link
Contributor

VonOx commented Aug 24, 2018

Description

  • Type: Enhancement | Question

Enhancement

Suggested enhancement

Enhance power api like yamaha-nodejs

powerStatus return object like { PWR : true }

Implement or modify existing power api like yamaha package return:

onkyo.isOn()
onkyo.isOff()

What do you think about this feature ?

@jupe
Copy link
Owner

jupe commented Aug 24, 2018

yamaha-nodejs implementation for isOn()/isOff() looks like it returns true/false depend on cached status - right ? in fact there is cache for these already - onkyo.deviceState.PWR -for example, which should tell if powers are on/off. I could add functions for it like you proposed :)

@jupe jupe mentioned this issue Aug 24, 2018
2 tasks
@VonOx
Copy link
Contributor Author

VonOx commented Aug 24, 2018

Yes you are right.

I just think this is more natural, I have already implemented deviceState so this is not a problem right now.

Just an idea. Feel free to close this issue😉

@jupe jupe closed this as completed in #25 Aug 24, 2018
@jupe
Copy link
Owner

jupe commented Aug 24, 2018

sorry, I did it already and released to npm :D

@jupe
Copy link
Owner

jupe commented Aug 25, 2018

I just looked a vit more deeply yamaha library and yes it is Promise api - it was wrapped to promise based here: https://github.com/PSeitz/yamaha-nodejs/blob/0bd1d83371061332a30bfefbb2f9d76c6c5002bf/simpleCommands.js#L452 .

So onkyo.js behaviours now a bit different than yamaha lib for isOn and isOff -functions. Perhaps I should switch that to Promise based - at least it is always up-to-date because no cached value needed..

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants