moustic999 / bosch-thermostat-http-client-python

Python3 asyncio package to talk to Buderus KM200
Apache License 2.0
10 stars 29 forks source link

encryption changes #12

Closed pszafer closed 5 years ago

pszafer commented 5 years ago

changes in encryption class to retrieve key and store key instead of passwords.

moustic999 commented 5 years ago

I think it should be better to always take access_key and password already encrypted in Encryption. Gateway should be enhnaced to take them encrpyted already. having an extra method which encrypt password and access-key would be better this way, HA integration could request clear password and access-key and store them encrypted. gateway constructor would be always called with encrypted.

that will also allow us to have a cli.py to use the library directly in command-line, where you would enter also manually password and key .

pszafer commented 5 years ago

ok, I have to push my HA fork so you can see how it looks like :)

I store this in HA:

self._saved_key = key_hash.hexdigest() + password_hash.hexdigest()
pszafer commented 5 years ago

Check it out. https://github.com/pszafer/home-assistant/tree/bosch_thermostat

You should be able to run it without any config and shoud appear as discovered device. To have your lib available run in HA directory ln -s /path/to/lib lib/python3.7/site-packages/bosch_thermostat_http