feat: mute the TV while the box listens, if the brain turns that on
check / check (push) Waiting to run
check / check (push) Waiting to run
whisper hears people better without the show behind them. The brain sets a mute code (and an unmute code, if not the same) with mute_while_listening on its ir capability, or turns it off; ir-server keeps the setting in its state directory. Mute is often a toggle, and the camera can't reliably tell whether the sound is off, so the box senses nothing: the setting is the brain's to turn on or off. The button service holds a connection to ir-server's conversation socket for each conversation: ir-server mutes when it opens and unmutes, with the same codes, when it closes. The socket's group is the button's alone, and the button still can't send any code. Generated-by: Claude Opus 5.5
This commit is contained in:
1 parent
5191ee9931
commit
f50c871521
10 files changed
+269
-22
No files matched your search
@@ -82,6 +82,14 @@ const IR_TOOLS = [
|
||||
required: ['code'],
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'mute_while_listening',
|
||||
description: 'Have the box mute the TV (or receiver, or sound bar) during every conversation, so it hears people over the show: it sends code when someone presses the button, and unmute_code (or code again, for a mute button that toggles) at goodbye. No code turns it off. The box cannot tell whether the TV is muted, so this is a setting, not a sensor: turn it on only with a mute code you have confirmed, and off if muting goes wrong (the TV left muted, or unmuted while listening). Changing the volume in a conversation can unmute some TVs, so that goodbye\'s toggle mutes them again: then use look, or ask, and fix it with ir_send.',
|
||||
inputSchema: {
|
||||
type: 'object',
|
||||
properties: { code: { type: 'string' }, unmute_code: { type: 'string' } },
|
||||
},
|
||||
},
|
||||
];
|
||||
|
||||
const LOOK_TOOL = {
|
||||
@@ -181,6 +189,11 @@ const main = async ({
|
||||
log(`ir_listen ${args.seconds}: ${JSON.stringify(heard)}`);
|
||||
return textResult(JSON.stringify(heard));
|
||||
}
|
||||
if (name === 'mute_while_listening') {
|
||||
const outcome = await callIr((ir) => ir.muteWhileListening(args.code || undefined, args.unmute_code || undefined));
|
||||
log(`mute_while_listening: ${outcome}`);
|
||||
return textResult(outcome);
|
||||
}
|
||||
const sent = await callIr((ir) => ir.send(String(args.code ?? ''), args.times ?? 1, args.gap_ms ?? 400));
|
||||
log(`ir_send: ${sent}`);
|
||||
return textResult(sent);
|
||||
|
||||
Reference in new issue
Block a user