Exception when used in input mode
Traceback (most recent call last):
File "/usr/lib/python3.7/asyncio/events.py", line 88, in _run
self._context.run(self._callback, *self._args)
File "/usr/lib/python3.7/asyncio/selector_events.py", line 913, in _call_connection_lost
super()._call_connection_lost(exc)
File "/usr/lib/python3.7/asyncio/selector_events.py", line 687, in _call_connection_lost
self._protocol.connection_lost(exc)
File "/home/pi/.local/lib/python3.7/site-packages/yaqd_core/_daemon.py", line 104, in connection_lost
self._daemon._connection_lost(peername)
File "/home/pi/source/yaqd-rpi-gpio/yaqd_rpi_gpio/_pin.py", line 27, in _connection_lost
self.controller.value = 0
File "/home/pi/.local/lib/python3.7/site-packages/gpiozero/devices.py", line 148, in __setattr__
return super(GPIOBase, self).__setattr__(name, value)
AttributeError: can't set attribute
Basically, you cannot set controller.value
when mode
is "input"
This is done in several places (the most obvious being set_value
, but also in __init__
and in the _connection_lost
callback.)
The one in __init__
is solved by simply indenting so that it is in the "out" block.
The others, while annoying, do not actually cause real problems, I don't think
Edited by Kyle Sunden