Freenove / WebIOPi

WebIOPi-0.7.1 for Raspberry B+, Pi2, Pi3, and Pi4
21 stars 8 forks source link

AttributeError: 'PiFaceDigital' object has no attribute 'close' #6

Open noanight opened 2 years ago

noanight commented 2 years ago

Shutting down WebIOPi with pifFace configured throws an AttributeError

Log

2022-04-21 20:50:14 - WebIOPi - INFO - HTTP Server stopped
2022-04-21 20:50:14 - WebIOPi - DEBUG - Closing device GPIO - GPIO
2022-04-21 20:50:14 - WebIOPi - DEBUG - Closing device pifaceModule - PiFaceDigital(0)
2022-04-21 20:50:14 - WebIOPi - ERROR - 'PiFaceDigital' object has no attribute 'close'
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/dist-packages/WebIOPi-0.7.1-py3.9-linux-armv6l.egg/webiopi/__main__.py", line 75, in <module>
    main(sys.argv)
  File "/usr/local/lib/python3.9/dist-packages/WebIOPi-0.7.1-py3.9-linux-armv6l.egg/webiopi/__main__.py", line 71, in main
    server.stop()
  File "/usr/local/lib/python3.9/dist-packages/WebIOPi-0.7.1-py3.9-linux-armv6l.egg/webiopi/server/__init__.py", line 143, in stop
    manager.closeDevices()
  File "/usr/local/lib/python3.9/dist-packages/WebIOPi-0.7.1-py3.9-linux-armv6l.egg/webiopi/devices/manager.py", line 54, in closeDevices
    device.close()
AttributeError: 'PiFaceDigital' object has no attribute 'close'
2022-04-21 20:50:15 - WebIOPi - INFO - CoAP Server stopped

Possible fix

adding attribute close to piface.py

    def close(self):
        None