From 874218e3ff0ffd244936b3d56f1645efc3f9519f Mon Sep 17 00:00:00 2001 From: jacqueline Date: Mon, 15 Apr 2024 14:53:41 +1000 Subject: Fix some bt device issues - Don't allow adjusting volume if there's no device - Cap bt nvs values correctly - Persist bt volumes correctly even when the encoded for has a null byte (facepalm 4 me) --- src/audio/bt_audio_output.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/audio/bt_audio_output.cpp') diff --git a/src/audio/bt_audio_output.cpp b/src/audio/bt_audio_output.cpp index 8f2b8cf3..229a38bb 100644 --- a/src/audio/bt_audio_output.cpp +++ b/src/audio/bt_audio_output.cpp @@ -90,7 +90,7 @@ auto BluetoothAudioOutput::SetVolumeDb(int_fast16_t val) -> bool { } auto BluetoothAudioOutput::AdjustVolumeUp() -> bool { - if (volume_ == 100) { + if (volume_ == 100 || !bluetooth_.IsConnected()) { return false; } volume_++; @@ -99,7 +99,7 @@ auto BluetoothAudioOutput::AdjustVolumeUp() -> bool { } auto BluetoothAudioOutput::AdjustVolumeDown() -> bool { - if (volume_ == 0) { + if (volume_ == 0 || !bluetooth_.IsConnected()) { return false; } volume_--; -- cgit v1.2.3