smbaker / pynest

python API for talking to nest thermostat
165 stars 81 forks source link

COSM integration, separation of library and script #8

Open vzaliva opened 11 years ago

vzaliva commented 11 years ago

Please take a look at some changes I did and feel free to merge them if you find them useful. Major ones:

  1. Separated command line script from library, so the library could be used by other scripts
  2. Added script to upload nest data to COSM.com

Vadim

evilpete commented 11 years ago

the splitting into a script & lib makes some sense ( although not necessary )

I do not see the reason to integrate COSM.com into the primary nest library, any 3party site features should be in they own repository or added to a example apps sub directory

eg: in my API lib for the ISY home controller I add a separate script program to that uses nest features as an example application [ https://github.com/evilpete/ISYlib-python/blob/master/bin/isy_nestset.py]

vzaliva commented 11 years ago

I agree in general but it depends on your definitions of the library. The core nest communications and COSM functionality are separate modules, just packaged together. One can use PYNEST module without COSM but not another way around.

I can keep COSM integration stuff in my repository. What I would love to is to be able to install PYNEST as a python module and use it as an external dependency instead of packaging it with my code. For this the separation of the script and the library is necessary. Setuptools install library modules in python path and I can easily import them. Currently the script is installed in different directory and I could not import it without knowing the path.