hellqvio86 / casambi

Python code for controlling Casambi lights
MIT License
10 stars 3 forks source link

Function for getting state of units #1

Closed rokdd closed 4 years ago

rokdd commented 4 years ago

Nice API. I found no function how to get the state of the unit.. Do you realise to get this data by another way or the function is just missing?

hellqvio86 commented 4 years ago

Thanks!

I have moved on to https://github.com/hellqvio86/aiocasambi (asynchronous version of this API), they send the state over the virtual wire (websocket).

I am using that in this project https://github.com/hellqvio86/home_assistant_casambi (home assistant integration for casambi).

hellqvio86 commented 4 years ago

I have raised a feature request (getting state over the rest api), but they have not yet implemented it (they probably never will). So now you need to listen on the websocket for incoming messages and they usually send all the state over the socket when you connect. So one way of doing it is to connect over websocket wait for the state, then disconnect, return result etc.

rokdd commented 4 years ago

Ok I did not saw that you have also another library ;-) I will try to check the async out, next time. I assume the normal casambi library is kind of deprecated now :-)