Skip to content
Open
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/thunder/ctrlm_thunder_plugin_powermanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ bool ctrlm_thunder_plugin_powermanager_t::get_wakeup_reason_voice() {

sem_wait(&this->semaphore);
if(this->call_plugin("getLastWakeupReason", (void *)&params, (void *)&response)) {
wakeup_reason_voice = (0 == strncmp(response["result"].String().c_str(), "VOICE", 5));
wakeup_reason_voice = (response["wakeupReason"].String() == "WAKEUP_REASON_VOICE");
XLOGD_DEBUG("voice_wakeup is %s", wakeup_reason_voice?"TRUE":"FALSE");
Copy link

Copilot AI Apr 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

get_wakeup_reason_voice() now reads response["wakeupReason"] and compares it to "WAKEUP_REASON_VOICE", but the surrounding inline curl example (and the previous implementation) indicate the method returns a string in the result field (e.g., {"result":"COLDBOOT"}), with voice detection based on a "VOICE" prefix. As written, this will likely always evaluate to false on existing PowerManager responses.

Consider parsing the response in a backward-compatible way (e.g., check for wakeupReason first, otherwise fall back to result), and guard access with HasLabel() to avoid relying on default/empty values. Also update the inline curl example if the plugin API truly changed.

Copilot uses AI. Check for mistakes.
} else {
XLOGD_ERROR("getLastWakeupReason call failed");
Expand Down
Loading