phillipsnick / unipi-evok

Node JS wrapper for UniPi API
MIT License
1 stars 2 forks source link

Problem with my UniPi #11

Open andyp17 opened 6 years ago

andyp17 commented 6 years ago

Hello, First I want to thank you for writing this module. I think the UniPi is great and deserves further development... ;) I tried your code but I ran into 2 issues:

  1. your function relays() in client.js returns a sorted list of the relays. But the relay_type does not work for me. Only when i remove && device.relay_type === 'physical' from the return-statement, the list comes back.
  2. Everytime when I run the code, I get the error "TypeError: message.forEach is not a function" in the parse-function in api.js. Only when I remove this.on('message', this.parse.bind(this)) in the constructor of the evok-class it works.

Can you give me a hint what is wrong there?

Many thanks!

kr Andy

phillipsnick commented 6 years ago

Hi Can you confirm which UniPi you are using?

Thanks

andyp17 commented 6 years ago

I use the UniPi 1.1 https://www.unipi.technology/unipi-1-1-p36

thanks