Skip to content

Commit 8477e59

Browse files
malysclaude
andcommitted
fix(radio): honour the "enable radio" switch when tuning
The switch added in 2.1.0 only governed the wait/play rows the editor appends after the tune action; the tune itself went through SaicRadio.tune, which called the vendor's srcPlayRadio every time, so the radio took over the speakers with the switch off. EVHardware 1.1.0 splits tuning from playback, and the executor now starts playback only when Action.flag is set. The check lives in the executor rather than only in ActionBundles because rules saved before 2.1.0 carry the flag but no wait/play rows; playing twice for rules that do have them is a no-op, the source is already the radio. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
1 parent 101dec1 commit 8477e59

4 files changed

Lines changed: 22 additions & 4 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,19 @@ All notable changes to this project are documented here. Format follows
44
[Keep a Changelog](https://keepachangelog.com/en/1.1.0/); versions follow
55
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [2.1.2] - 2026-08-22
8+
9+
### Fixed
10+
11+
- **"Tune and play radio" started the radio even with the switch turned off.** The switch
12+
added in 2.1.0 only controlled the wait/play rows the editor appends after the tune
13+
action; the tune itself went through `SaicRadio.tune`, which called the vendor's
14+
`srcPlayRadio` on every tune and made the radio the current audio source regardless. A
15+
rule meant to preset a station while music kept playing took over the speakers instead.
16+
Tuning and playback are now separate vendor calls, and the action starts playback only
17+
when the switch is on. Rules saved before 2.1.0, which carry no wait/play rows, keep
18+
playing as they always did.
19+
720
## [2.1.1] - 2026-08-21
821

922
### Fixed

‎app/build.gradle.kts‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ android {
1010
applicationId = "com.evsuite.tasker"
1111
minSdk = 28
1212
targetSdk = 34
13-
versionCode = 5
14-
versionName = "2.1.1"
13+
versionCode = 6
14+
versionName = "2.1.2"
1515
}
1616

1717
// EVTasker doit être signé avec la MÊME clé plateforme que EVProfile : c'est la seule

‎app/src/main/java/com/evsuite/tasker/vehicle/DirectExecutor.kt‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,11 +181,16 @@ class DirectExecutor(
181181
* A frequency the driver typed. Text that names no station is unsupported, not an error:
182182
* retrying "FM 250" three times with backoff will not make it a station, and the history
183183
* showing what was typed is what lets the user find the typo.
184+
*
185+
* Playback follows [Action.flag], the editor's "enable radio" switch, even though
186+
* [com.evsuite.tasker.ui.ActionBundles] also appends a play tail when it is on: rules
187+
* saved before that tail existed carry the flag but no tail, and would otherwise tune in
188+
* silence. Playing twice is a no-op — the source is already the radio.
184189
*/
185190
private fun tuneRadio(a: Action): ActionResult {
186191
val station = RadioFrequency.parse(a.text)
187192
?: return ActionResult(a.type, false, BridgeContract.VERDICT_UNSUPPORTED, "not a frequency: ${a.text}")
188-
val ok = SaicRadio.tune(station.band, station.frequencyKhz)
193+
val ok = SaicRadio.tune(station.band, station.frequencyKhz) && (!a.flag || SaicRadio.play())
189194
return ActionResult(
190195
a.type,
191196
ok,

0 commit comments

Comments
 (0)