-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
433MHz 0x or no 0x depending on module #22919
Comments
Discussion on Discord: https://discord.com/channels/479389167382691863/490244847568158751/1335280188002406494 Maybe SetOption28 can be extended with 2 additional options, „Hex with 0x as prefix“ and „Hex without the prefix“. |
It's all about squeezing the most functionality out of as small as possible code base. JSON does not support hexadecimal as a number so it needs to be shown as a string hence the quotes. For Tasmota that is enough to separate between decimal and hexadecimel (number or string). Later implementations started to still use a string but prefixed it with "0x" which makes totally sense but increased the code base by 2 bytes for every hexadecimal value. Changing the legacy version from "FDF0A4" to "0xFDF0A4" while likely break current automations in the back-end. So for now we keep it as it is and your automations can still function as they should as long as you process the data missing "0x". NB. While at the topic of hexadecimal and decimal numbers, Tasmota's JSON input implementation does allow a hexadecimal number as number (and not a s string) for input. This is not according to the JSON definition but luckily there is a JSON5 definition (which I never heard of before today but seems to be much more relaxed). |
Summary: No global solution, because a solution can cause unexpected problems with other existing systems if the 0X is suddenly new or no longer included. If necessary, change the corresponding lines of code self in a user-defined manner or prepare these characters externally in the desired format. I can live with it, and just change the things to decimal. on this occasion a word of many thanks for the great Tasmota software. |
Thanks Theo for your explanation. Another possibility would be to use a #define (for "self compiled") in order to remain backwards compatible on the one hand and to achieve harmonization on the other. |
A define can be done easily. Let me chk ... |
Done. |
Thanks again for this great project! |
PROBLEM DESCRIPTION
Inconsistent output of received data at 433MHz one have 0x and other not.
REQUESTED INFORMATION
Make sure your have performed every step and checked the applicable boxes before submitting your issue. Thank you!
Backlog Template; Module; GPIO 255
:lua
Configuration output here:
TO REPRODUCE
Compare Data in Hex with Tasmota 433MHz Bridge-Box and ESP32-C + RXB6 433MHz Module
The one show Data in Hex with beginning 0x the other one not.
EXPECTED BEHAVIOUR
I think both should in hex look same.
SCREENSHOTS
If applicable, add screenshots to help explain your problem.
ADDITIONAL CONTEXT
In a Tasmota help form, a user named Noschvie pointed out that the following lines probably show the difference clearly.
tasmota\tasmota_xdrv_driver\xdrv_17_rcswitch.ino / Line number 69
tasmota\tasmota_xdrv_driver\xdrv_06_snfbridge.ino / Line number 245
(Please, remember to close the issue when the problem has been addressed)
The text was updated successfully, but these errors were encountered: