mhrivnak / radiotherm

python client library for Radio Thermostat wifi-enabled home thermostats
BSD 3-Clause "New" or "Revised" License
49 stars 40 forks source link

radiotherm fails silently #14

Closed JerryWorkman closed 6 years ago

JerryWorkman commented 8 years ago

Radio Thermostat CT80 Rev B2 V1.09

> python
Python 2.7.6 (default, Jun 22 2015, 17:58:13)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import radiotherm
>>> tstat = radiotherm.get_thermostat()
>>> tstat.temp
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'temp'
>>> tstat = radiotherm.get_thermostat('192.168.10.129')
>>> tstat.temp
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'NoneType' object has no attribute 'temp'
>>> str(tstat)
'None'
>>>^D

>curl http://192.168.10.129/tstat
{"temp":70.50,"tmode":3,"fmode":2,"override":0,"hold":1,"t_heat":72.00,"t_cool":77.00,"ttarget":1,"program_mode":1,"tstate":1,"fstate":1,"time":{"day":2,"hour":20,"minute":19},"t_type_post":0}

>~/radiotherm-master# ./run-tests.sh
...............................
----------------------------------------------------------------------
Ran 31 tests in 0.028s

OK
>pip search radiotherm
radiotherm                - client library for wifi thermostats sold by
                            radiothermostat.com
  INSTALLED: 1.2 (latest)
stevejbauer commented 8 years ago

Is you have version 1.2 installed, the library will fail to query the thermostat since it doesn't understand the device (Radio Thermostat CT80 Rev B2 V1.09). The support for the ct80 Rev B2 V1.09 is waiting in one of the pull requests to be merged to the library.

JerryWorkman commented 8 years ago

Steve,

Radiotherm should throw an exception if it can not determine the model.

I have a pull request that does not require an exact match for the model. If there is no match it uses the base model (e.g. CT80). There is little to no difference between the models within a class. I've created a fork where this is implemented.

Jerry

On Wed, Jan 20, 2016 at 10:53 PM, Steve Bauer notifications@github.com wrote:

Is you have version 1.2 installed, the library will fail to query the thermostat since it doesn't understand the device (Radio Thermostat CT80 Rev B2 V1.09). The support for the ct80 Rev B2 V1.09 is waiting in one of the pull requests to be merged to the library.

— Reply to this email directly or view it on GitHub https://github.com/mhrivnak/radiotherm/issues/14#issuecomment-173443835.

stevejbauer commented 8 years ago

The current codebase did not appear to through an exception. The non exact match sounds like a better solution though.

JerryWorkman commented 8 years ago

Yes, I forgot to add that.

On Thu, Jan 21, 2016 at 1:17 PM, Steve Bauer notifications@github.com wrote:

The current codebase did not appear to through an exception. The non exact match sounds like a better solution though.

— Reply to this email directly or view it on GitHub https://github.com/mhrivnak/radiotherm/issues/14#issuecomment-173661786.

craftyguy commented 6 years ago

@JerryWorkman could you try #38, based on your PR #37?

craftyguy commented 6 years ago

This should be resolved now. Closing issue, but please re-open if someone continues to experience this after testing the latest in master branch.