Fixes an error with WakeButton, reported by @Orbiter
Checklist
[x] I have read the Contribution & Best practices Guide and my PR follows them.
[x] My branch is up-to-date with the Upstream master branch.
[ ] The unit tests pass locally with my changes
[ ] I have added tests that prove my fix is effective or that my feature works
[ ] I have added necessary documentation (if appropriate)
[ ] All the functions created/modified in this PR contain relevant docstrings.
Test Passing
[ ] The SUSI Server must be building on the pi on bootup
[ ] The hotword detection should have a decent accuracy
[ ] SUSI Linux shouldn't crash when switching from online to offline and vice versa (failing as of now)
[ ] SUSI Linux should be able to boot offline when no internet connection available (failing)
Short description of what this resolves:
Reported error log:
Feb 25 22:41:44 raspberrypi python3[559]: INFO: Susi has the wake button enabled
Feb 25 22:41:44 raspberrypi python3[559]: INFO: Susi runs on a RaspberryPi
Feb 25 22:41:44 raspberrypi python3[559]: /home/pi/SUSI.AI/susi_linux/main/hardware_components/rpi_wake_button.py:15: RuntimeWarning: This channel is already in use, continuing anyway. Use GPIO.setwarnings(False) to disable warnings.
Feb 25 22:41:44 raspberrypi python3[559]: GPIO.setup(18, GPIO.IN, pull_up_down=GPIO.PUD_UP)
Feb 25 22:41:44 raspberrypi python3[559]: Traceback (most recent call last):
Feb 25 22:41:44 raspberrypi python3[559]: File "/usr/lib/python3.5/runpy.py", line 193, in _run_module_as_main
Feb 25 22:41:45 raspberrypi python3[559]: "__main__", mod_spec)
Feb 25 22:41:45 raspberrypi python3[559]: File "/usr/lib/python3.5/runpy.py", line 85, in _run_code
Feb 25 22:41:45 raspberrypi python3[559]: exec(code, run_globals)
Feb 25 22:41:45 raspberrypi python3[559]: File "/home/pi/SUSI.AI/susi_linux/main/__main__.py", line 57, in <module>
Feb 25 22:41:45 raspberrypi python3[559]: susiStateMachine = SusiStateMachine()
Feb 25 22:41:45 raspberrypi python3[559]: File "/home/pi/SUSI.AI/susi_linux/main/states/susi_state_machine.py", line 94, in __init__
Feb 25 22:41:45 raspberrypi python3[559]: self.__idle_state = IdleState(components)
Feb 25 22:41:45 raspberrypi python3[559]: File "/home/pi/SUSI.AI/susi_linux/main/states/idle_state.py", line 27, in __init__
Feb 25 22:41:45 raspberrypi python3[559]: self.components.wake_button.subject.subscribe(
Feb 25 22:41:45 raspberrypi python3[559]: AttributeError: 'RaspberryPiWakeButton' object has no attribute ‚subject‘
Changes proposed in this pull request:
Original author of the code forgot to add subject attribute. I'm not sure what is the proper fix, because I haven't understood his intention yet. But let's try mimicking subject found in other classes (HotwordDetector).
Fixes an error with WakeButton, reported by @Orbiter
Checklist
Test Passing
Short description of what this resolves:
Reported error log:
Changes proposed in this pull request:
Original author of the code forgot to add
subject
attribute. I'm not sure what is the proper fix, because I haven't understood his intention yet. But let's try mimickingsubject
found in other classes (HotwordDetector
).