radinsky / broadlink-http-rest

Broadlink RM/RM2/RM Pro/RM3/BlackBean/A1 Web server with REST API (like..)
MIT License
156 stars 47 forks source link

AttributeError: rm instance has no attribute 'key' #30

Closed tobit6795 closed 4 years ago

tobit6795 commented 5 years ago

getting temperature works. this is what i get trying to learn rf signals

Exception happened during processing of request from ('192.168.0.11', 38202)
Traceback (most recent call last):
  File "/usr/lib/python2.7/SocketServer.py", line 293, in _handle_request_noblock
    self.process_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 321, in process_request
    self.finish_request(request, client_address)
  File "/usr/lib/python2.7/SocketServer.py", line 334, in finish_request
    self.RequestHandlerClass(request, client_address, self)
  File "/usr/lib/python2.7/SocketServer.py", line 655, in __init__
    self.handle()
  File "server.py", line 44, in handle
    self.handle_one_request()
  File "/usr/lib/python2.7/BaseHTTPServer.py", line 328, in handle_one_request
    method()
  File "server.py", line 60, in do_GET
    self.messageHandler()
  File "server.py", line 121, in messageHandler
    result = learnCommand(commandName,deviceName)
  File "server.py", line 302, in learnCommand
    deviceKey = device.key
AttributeError: rm instance has no attribute 'key'
radinsky commented 5 years ago

Is a new one, fresh setup? Can you send a command/url you're using?

thaasoph commented 5 years ago

Without digging too much into the code, I would assume the cause is this commit https://github.com/mjg59/python-broadlink/commit/38a40c5a19c05039e5c92ced1f553971ccd70d9e in which they apparently ditched the field "key" in Device.

Using version 0.10 of the broadlink module would be one possible workaround.