Package: python-ownet
Version: 2.8p15-1
Severity: grave

The ownet python module does not work properly. This script should open a
connection to the owserver on localhost, display the information for sensor
10.67C6697351FF and then print the value of its temperature attribute:

#!/bin/python
import ownet
r = ownet.Sensor('/10.67C6697351FF', 'localhost', 4304)
print r
print r.temperature

The connection works and the sensor information is shown, but the attribute
cannot be read because a library method is not found:

walter@walter-VirtualBox:~$ python test.py
localhost:4304/10.67C6697351FF - DS18S20
Traceback (most recent call last):
  File "test.py", line 5, in <module>
    print r.temperature
  File "/usr/lib/python2.7/dist-packages/ownet/__init__.py", line 252, in
__getattr__
    attr = object._connection.read(object.__getattribute__(self,
'_attrs')[name])
AttributeError: type object 'object' has no attribute '_connection'

This error can be fixed easily by editing line 252 in file
"/usr/lib/python2.7/dist-packages/ownet/__init__.py":

-- attr = object._connection.read(object.__getattribute__(self,
'_attrs')[name])
++ attr = self._connection.read(self.__getattribute__('_attrs')[name])

I have reproduced and fixed this bug on 2 machines:
* Raspbian on a Raspberry PI B with python 2.7.3-4+deb7u1
Linux smarthome 4.0.8+ #804 PREEMPT Tue Jul 14 12:57:44 BST 2015 armv6l
GNU/Linux
* Ubuntu 14.4 LTS with python 2.7.5-5ubuntu3
Linux walter-VirtualBox 3.13.0-57-generic #95-Ubuntu SMP Fri Jun 19
09:27:48 UTC 2015 i686 i686 i686 GNU/Linux

Reply via email to