rytilahti / python-eq3bt

Python library and command-line tool for eQ-3 Smart Bluetooth thermostats
MIT License
115 stars 36 forks source link

AttributeError: 'NoneType' object has no attribute 'MANUAL' #29

Open jempo opened 5 years ago

jempo commented 5 years ago

I've this problem when i connect to my EQ3. I'm running the latest version 0.1.10 in Homeassistant Env.

Traceback (most recent call last):
  File "/srv/homeassistant/bin/eq3cli", line 10, in <module>
    sys.exit(cli())
  File "/srv/homeassistant/lib/python3.5/site-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/srv/homeassistant/lib/python3.5/site-packages/click/core.py", line 1114, in invoke
    return Command.invoke(self, ctx)
  File "/srv/homeassistant/lib/python3.5/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/srv/homeassistant/lib/python3.5/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/eq3bt/eq3cli.py", line 38, in cli
    ctx.invoke(state)
  File "/srv/homeassistant/lib/python3.5/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/srv/homeassistant/lib/python3.5/site-packages/eq3bt/eq3cli.py", line 160, in state
    click.echo(dev)
  File "/srv/homeassistant/lib/python3.5/site-packages/click/utils.py", line 222, in echo
    message = text_type(message)
  File "/srv/homeassistant/lib/python3.5/site-packages/eq3bt/eq3btsmart.py", line 97, in __str__
    self.mode_readable,
  File "/srv/homeassistant/lib/python3.5/site-packages/eq3bt/eq3btsmart.py", line 265, in mode_readable
    if mode.MANUAL:
AttributeError: 'NoneType' object has no attribute 'MANUAL'
mbugert commented 5 years ago

I had the same issue with two EQ3 thermostats which behaved strangely. Bluetooth pairing and connecting was working fine, but any further interaction failed. eq3cli failed with the error above. I suspected this library, bluepy and bluez first, then I noticed that the official app also could not control the thermostats anymore. The solution was to simply remove and reinsert the batteries... 🙄

rytilahti commented 5 years ago

The tool could have nicer error reporting when it cannot establish the connection or fails to read data from the device.

kinvaris commented 4 years ago

I'm having the exact same issue. But for me the app still works and I am still able to connect via the Cli.

ropperto commented 3 years ago

Hello, after upgrading the firmware via calor app I can't connect anymore to the thermostat and get the error: AttributeError: 'NoneType' object has no attribute 'MANUAL' The app still works fine. EDIT _Complete log below: DEBUG:eq3bt.eq3btsmart:Querying the device.. DEBUG:eq3bt.connection:Trying to connect to 00:1A:22:12:4B:E1 DEBUG:eq3bt.connection:Connected to 00:1A:22:12:4B:E1 DEBUG:eq3bt.connection:Writing b'03140b0b140403' to 1041 with with_response=True DEBUG:eq3bt.connection:Waiting for notifications for 1 Traceback (most recent call last): File "/home/pi/homeassistant/bin/eq3cli", line 10, in sys.exit(cli()) File "/home/pi/homeassistant/lib/python3.7/site-packages/click/core.py", line 829, in call return self.main(args, kwargs) File "/home/pi/homeassistant/lib/python3.7/site-packages/click/core.py", line 782, in main rv = self.invoke(ctx) File "/home/pi/homeassistant/lib/python3.7/site-packages/click/core.py", line 1236, in invoke return Command.invoke(self, ctx) File "/home/pi/homeassistant/lib/python3.7/site-packages/click/core.py", line 1066, in invoke return ctx.invoke(self.callback, ctx.params) File "/home/pi/homeassistant/lib/python3.7/site-packages/click/core.py", line 610, in invoke return callback(args, kwargs) File "/home/pi/homeassistant/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func return f(get_current_context(), *args, *kwargs) File "/home/pi/homeassistant/lib/python3.7/site-packages/eq3bt/eq3cli.py", line 38, in cli ctx.invoke(state) File "/home/pi/homeassistant/lib/python3.7/site-packages/click/core.py", line 610, in invoke return callback(args, kwargs) File "/home/pi/homeassistant/lib/python3.7/site-packages/click/decorators.py", line 21, in new_func return f(get_current_context(), *args, **kwargs) File "/home/pi/homeassistant/lib/python3.7/site-packages/eq3bt/eq3cli.py", line 185, in state click.echo(dev) File "/home/pi/homeassistant/lib/python3.7/site-packages/click/utils.py", line 234, in echo message = text_type(message) File "/home/pi/homeassistant/lib/python3.7/site-packages/eq3bt/eq3btsmart.py", line 107, in str self.mode_readable, File "/home/pi/homeassistant/lib/python3.7/site-packages/eq3bt/eq3btsmart.py", line 307, in modereadable if mode.MANUAL: AttributeError: 'NoneType' object has no attribute 'MANUAL' Don't kow if the problem is related to the firmware update but other termostats are working and don't kow how to downgrade.