Skip to content

feat: add car Bluetooth recipe - #7

Merged
wized2 merged 1 commit into
wized2:betafrom
am-official:feat/car-bluetooth-recipe
Oct 25, 2026
Merged

wized2 merged 1 commit into
wized2:betafrom
am-official:feat/car-bluetooth-recipe

Conversation

@am-official

Copy link
Copy Markdown

Closes #2

Summary

Adds recipes/car_bluetooth.json. When a Bluetooth device connects (BLUETOOTH_CONNECTED), it sets the ringer to vibrate (RINGER_MODE with ringerMode: VIBRATE) and posts a notification. It also adds an entry to recipes/README.md.

Device filter: RuleEngine.onBluetooth fires BLUETOOTH_CONNECTED for every device and does not read triggerParam, so there is no per-device filter to preset. As the issue asks, the rule's notes and the README entry say the rule fires for any device (earbuds and watches too) and that the user has to refine it, for example with a condition or a car profile.

Schema check: the file uses the same fields as the existing recipes. I checked every trigger, action, condition and ringer name against the enums that Rule.fromJson / RuleAction.fromJson pass to valueOf, and all names in the new file are valid.

While checking, I noticed three existing recipes use names that aren't in those enums. valueOf throws on them, so I expect importing them to fail:

  • charging_notify.json: trigger POWER_CONNECTED (the enum has CHARGER_CONNECTED)
  • night_dnd.json and work_wifi_silent.json: action SET_RINGER (the enum has RINGER_MODE)

I left them out of this PR to keep it to the issue. I'm happy to send a separate fix if you'd like one.

Target

  • beta (default)
  • main (stable hotfix only)

Checklist

  • PR targets beta unless hotfix
  • Tests for RuleLogic / pure helpers when applicable (n/a: JSON recipe only, no code changes)
  • No INTERNET / trackers added

recipes/car_bluetooth.json sets the ringer to vibrate (RINGER_MODE,
ringerMode VIBRATE) and posts a notification when a Bluetooth device
connects (BLUETOOTH_CONNECTED). The trigger has no per-device filter,
so it fires for earbuds and watches too; the rule notes and the
recipes README say so and ask the user to refine it before relying on
it.

Closes wized2#2

@wized2 wized2 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

LGTM

@wized2 wized2 left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Looks good — targets beta, valid BLUETOOTH_CONNECTED / RINGER_MODE / VIBRATE / NOTIFY, and the notes correctly explain the any-device limitation.

@wized2
wized2 merged commit 08b38eb into wized2:beta Oct 25, 2026
@wized2

wized2 commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Merged — thanks @am-official!

Good catch on the existing recipe enum mismatches (POWER_CONNECTED vs CHARGER_CONNECTED, SET_RINGER vs RINGER_MODE). A follow-up PR on beta to fix those three files would be welcome.

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