Skip to content

Fix: Convert StringRef to const char* in wake word engine checks for HA 2026.1#28

Closed
simoozzay wants to merge 1 commit intom5stack:mainfrom
simoozzay:bugfix/string-conversion
Closed

Fix: Convert StringRef to const char* in wake word engine checks for HA 2026.1#28
simoozzay wants to merge 1 commit intom5stack:mainfrom
simoozzay:bugfix/string-conversion

Conversation

@simoozzay
Copy link

Fix: Convert StringRef to const char* in wake word engine checks

Description

This PR fixes a type conversion issue in the atoms3r-with-echo-base.yaml configuration file where current_option() returns a StringRef object that needs to be converted to const char* using .c_str() before comparison with string literals.

Problem

The lambda functions were attempting to directly assign the result of current_option() to a const char* pointer without proper conversion, which could cause compilation issues or runtime errors depending on the ESPHome version.

Solution

Added .c_str() method calls to all wake word engine location checks to properly convert the StringRef return value to a C-style string pointer.

Changes

  • Updated 6 lambda functions in common/atoms3r-with-echo-base.yaml to use .c_str() for proper type conversion
  • Ensures compatibility with the select API changes introduced in ESPHome 2025.12.0

Files Changed

  • common/atoms3r-with-echo-base.yaml

@parker-int64
Copy link
Contributor

Hi, thanks for the PR.

The has been fixed in 7212bc8

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.

2 participants