Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In my case, I've done a migration from https://github.com/outlying/MMM-PIR-Sensor (deprecated) to this project. Until now, I have configured my system to use GPIO 23. It really gave me a headache as to why it was not working since it worked with the previous module and when tested from the CLI.
I'm using an RPi3 (which is OK for MM), and for the RPi3, the GPIO pins go as far as 29. For the RPi4 and RPi5, the maximum GPIO is 27.
The artificial limit of 21 used in this project makes no sense at all in any case for past and present RPis.
I also checked the https://github.com/gpiozero/gpiozero/blob/master/gpiozero/input_devices.py#L525 project that is used to get the sensor state, and it also does not limit the GPIO number in any way.
When I changed this restriction, my sensor started working simply because there was no assertion error.