Skip to content
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

[RTL] Correct string handling for type key in NAMING_KEYS #1960

Merged
merged 3 commits into from
Jun 12, 2024

Conversation

riegelbrau
Copy link
Contributor

Extend class structure RTL_433device and modify code to create correct state topic in discovery message to support sensors, that send type key as well as sensors, that don't. Actually only TPMS sensors use type=TPMS. See issue #1909.

Description:

The key type of the naming_keys array in ZgatewayRTL_433.ino was not used to create the state topic in discovery messages. Thcaused, that for TPMS sensors the state topic was incorrectly created. With this change, both cases are respected, when key is used and when key is not used.

I tested with my sensors TPMS Jansite-Solar (FSK) and AmbientWeather-TX8300-1-65 (OOK). The sensors were correctly discovered and configured in my openHAB instance.

Checklist:

  • The pull request is done against the latest development branch
  • Only one feature/fix was added per PR and the code change compiles without warnings
  • I accept the DCO.

Extend class structure RTL_433device and modify code to create correct state topic in discovery message to support sensors, that send type key as well as sensors, that don't. Actually only TPMS sensors use type=TPMS.
@riegelbrau
Copy link
Contributor Author

Who can help me with the Code Format error? I cannot see, what's wrong.

@DigiH
Copy link
Collaborator

DigiH commented Jun 9, 2024

@riegelbrau you have extra spaces after several lines in both files.

Don't you get Format Document when right clicking into files in VSC? This should automatically format code correctly as defined by the included .clang-format.

@riegelbrau
Copy link
Contributor Author

Thanks @DigiH, this pointed me to the reason. I do not yet edit with VSCode, but use Notepad++, because I am familiar with it. There I can also see trailing spaces and remove them. I did so and now the PR compiled successfully.

@DigiH
Copy link
Collaborator

DigiH commented Jun 9, 2024

You even caught some extra spaces in the commented starting section of config_RF.h which the automatic clang formatting missed, it only looking at actual code 😄

@riegelbrau
Copy link
Contributor Author

I recognized that. Is it good or bad?

@DigiH
Copy link
Collaborator

DigiH commented Jun 9, 2024

It's good 👍

@1technophile 1technophile changed the title Correct string handling for type key in NAMING_KEYS [RTL] Correct string handling for type key in NAMING_KEYS Jun 10, 2024
@1technophile
Copy link
Owner

Thanks

@1technophile 1technophile merged commit 23b3123 into 1technophile:development Jun 12, 2024
72 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants