-
Notifications
You must be signed in to change notification settings - Fork 804
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Basic whitelisting/blacklisting support for ZgatewayRF #919
Basic whitelisting/blacklisting support for ZgatewayRF #919
Conversation
76f6567
to
af13858
Compare
Made it to compile for the AVR arch but no ARDUINO UNO support due to limited resources available. |
40bcc10
to
4ac7122
Compare
… for preprocessor directives - any reason why ???
Should fix #568 as well. As a future enhancement I think I can add the ability to filter based on a range like this:
instead of writing all those id's by hand which can be tedious when you have many around. Same for blacklisting. But let's keep this PR as it is right now because as I already mentioned in the title it adds |
It's quite inefficient to send white/black list via MQTT and JSON due to RAM constraints for embedded devices. And the current implementation that I made may not be efficient as well because of the fact that one cannot send long lists of id's. I updated the readme with the details. It should be more efficient when using ranges like I mentioned in the previous comment. Yet again I will opt for a web interface that the Gateway should expose and do some configuration things there which get stored on the internal flash. This should be not that trivial to implement for the ESP32/8266 platforms. |
Thanks for the PR, I will look at it next week |
@@ -82,6 +82,7 @@ extra_configs = | |||
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | |||
|
|||
[libraries] | |||
arduino_stl = ciband/avr_stl @ ^1.2.3 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For Zgateway BT White and blacklist mechanism we use:
`stl = https://github.com/mike-matera/ArduinoSTL.git#7411816`
The one that you are proposing seems more maintained. Would it be possible to do the replacement into platformio.ini so as to use only yours?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure.
# if defined(ESP32) || defined(ESP8266) || defined(__AVR_ATmega2560__) || defined(__AVR_ATmega1280__) | ||
# include <vector> | ||
using namespace std; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have a difference between your macro segmentation and the one in ZgatewayBT:
# if !defined(ESP32) && !defined(ESP8266)
# include <ArduinoSTL.h>
# endif
# include <vector>
using namespace std;
It could be interesting to unify both as we are talking about the same function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, this one is more concise and shorter. Will do.
Thanks for the PR, we may have in a future PR to think about factoring white and blacklist functions between the different gateways. |
Could be a nice option |
Basic whitelisting/blacklisting support for the ZGatewayRF. Nothing fancy or complicated just a simple filtering based on the unique RC switch code being sent. This avoids creating in Home Assistant for example redundant entities because the RF receiver "catches signals" from other devices around the house or neighbors.
I tested both whitelisting/blacklisting and seems to work as expected. Disabling whitelisting/blacklisting is also supported.
Hope it helps.