-
-
Notifications
You must be signed in to change notification settings - Fork 29
fix: replace deprecated state.c_str() with current_option() #287
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
base: main
Are you sure you want to change the base?
Conversation
- Replace all 17 occurrences across 5 YAML files - watermeter.yaml: 3 replacements - water-resistor.yaml: 3 replacements - s0-watermeter.yaml: 4 replacements - gaspuls.yaml: 4 replacements - tcrt5000.yaml: 3 replacements The current_option() method returns const char* directly, so no .c_str() conversion is needed. This fixes ESPHome deprecation warnings for Select components.
|
I'm going to test it out. |
|
Related to esphome/esphome#13095 I run same error when I try to update to ESPHome 2026.1.1 Same yaml works well with 2025.12.6 I will look into it. My yaml |
- Store current_option() result in auto variable before calling .c_str() - Fixes compatibility with ESPHome PR #13095 (StringRef return type) - Updated 5 files with 17 lambda expressions total: * gaspuls.yaml: 4 fixes * s0-watermeter.yaml: 4 fixes * tcrt5000.yaml: 3 fixes * water-resistor.yaml: 3 fixes * watermeter.yaml: 3 fixes This follows the migration guide from ESPHome PR #13095 where current_option() now returns StringRef instead of const char*.
|
I've updated all 5 YAML files that were modified in commit 3d4bf57 to properly handle the new Files Updated:✅ gaspuls.yaml- 4 lambda expressions fixed What Changed:Before (commit 3d4bf57): yaml After (new fix for StringRef): yaml Why This Fix is Needed:The previous commit replaced
|



The current_option() method returns const char* directly, so no .c_str() conversion is needed.
This fixes ESPHome deprecation warnings for Select components.
What does this implement/fix? / Wat implementeert/repareert dit?
Proposed change / Voorgestelde verandering.
Types of changes / Soorten wijzigingen .
Test Environment / Test Omgeving
Additional information / Aanvullende info
Supplying a configuration snippet / Voorbeeld invoer voor
configuration.yaml:# Example configuration.yamlChecklist / Checklijst:
If user-visible functionality or configuration variables are added/modified / Als door de gebruiker zichtbare functionaliteit of configuratievariabelen worden toegevoegd/gewijzigd :