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

Cannot configure "longer" mqtt topic than previously configured #90

Open
cakoolen opened this issue Mar 14, 2022 · 1 comment
Open

Cannot configure "longer" mqtt topic than previously configured #90

cakoolen opened this issue Mar 14, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@cakoolen
Copy link

Describe the bug
When I want to configure a longer mqtt topic name than previously configured, I cannot add the additional characters. So if my topic was co2 I cannot change it to co2-sensor for example.

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'Configuration/MQTT Config'
  2. Scroll down to 'Topic'
  3. Change 'Topic' to 'co2'
  4. Save configuration
  5. Go back to 'Configuration/MQTT Config'
  6. Scroll down to 'Topic'
  7. Change 'Topic' to 'co2-sensor'
  8. It is not possible to add the - character.

Expected behavior
It should be possible to add characters after the last character of the previous setting.

Additional context
Looking at the code, the problem might be related with truncating the tempstring before copying it to the used value here: https://github.com/melkati/CO2-Gadget/blob/master/CO2_Gadget_Menu.h#L383

Note that this pattern is used for most settings.

@melkati
Copy link
Owner

melkati commented Mar 19, 2022

I was able to replicate the issue.

As a workaround, until there is a fix, simply exit the menu and enter it again, then you should be able to input a longer topic. Make sure to be using latest release.

@melkati melkati added the bug Something isn't working label Mar 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Needs triage
Development

No branches or pull requests

2 participants