yozik04 / vallox_websocket_api

Async API for Vallox ventilation units. Is used in HomeAssistant.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

More highlevel commands?

spaetz opened this issue · comments

Hi,
I wonder if you would accept more high-level commands in addition to the fairly low-level websockets API.
I imagine something like:

from constants import HOME_STATE, AWAY_STATE, FIREPLACE_STATE, BOOSTER_STATE
Client.set_state(HOME_STATE)
Client.get_state --> (returns e.g. FIREPLACE_STATE)

I would be willing to work on these commands if you are willing to include the resulting pull requests :)

Sure, why not.

One thing to take into concern:

https://github.com/yozik04/vallox_websocket_api/blob/master/vallox_websocket_api/constants.py file is copy/paste from Vallox's javascript file with some minor changes for python syntax. I'd better would not touch that. If Vallox will change their JS file, it will be strait-forward to replace constants.py when required.

So I'd recommend to create new separate file to have this high level stuff...

OK, see my pull request. with code example. Only caveat is that I require the enum34 package on Python2 or the included enum package on >=python 3.4.

If that is not wanted, we could get rid of the enum, I just use it to give the PROFILEs nice names.

I've dropped enum stuff. Just created a class with vars. Works similar way.
See b078de4