Skip to content

Commit

Permalink
Update zp.js
Browse files Browse the repository at this point in the history
Add support for surround speaker settings, see #210.
  • Loading branch information
ebaauw committed Dec 10, 2023
1 parent a9771b8 commit 6410d24
Showing 1 changed file with 74 additions and 0 deletions.
74 changes: 74 additions & 0 deletions cli/zp.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ const usage = {
balance: `${b('balance')} [${b('-h')}] [${b('--')}] [${u('balance')}]`,
nightSound: `${b('nightSound')} [${b('-h')}] [${b('on')}|${b('off')}]`,
speechEnhancement: `${b('speechEnhancement')} [${b('-h')}] [${b('on')}|${b('off')}]`,
surroundEnable: `${b('surroundEnable')} [${b('-h')}] [${b('on')}|${b('off')}]`,
tvLevel: `${b('tvLevel')} [${b('-h')}] [${b('--')}] [${u('level')}]`,
musicLevel: `${b('musicLevel')} [${b('-h')}] [${b('--')}] [${u('level')}]`,
musicPlaybackFull: `${b('musicPlaybackFull')} [${b('-h')}] [${b('on')}|${b('off')}]`,
subEnable: `${b('subEnable')} [${b('-h')}] [${b('on')}|${b('off')}]`,
subLevel: `${b('subLevel')} [${b('-h')}] [${b('--')}] [${u('level')}]`,
led: `${b('led')} [${b('-h')}] [${b('on')}|${b('off')}]`,
Expand Down Expand Up @@ -79,6 +83,10 @@ const description = {
balance: 'Get/set balance.',
nightSound: 'Get/set/clear nightsound.',
speechEnhancement: 'Get/set/clear speech enhancement.',
surroundEnable: 'Get/set/clear surround enabled state.',
tvLevel: 'Get/set TV surround level.',
musicLevel: 'Get/set music surround level.',
musicPlaybackFull: 'Get/set/clear full music playback.',
subEnable: 'Get/set/clear Sub enabled state.',
subLevel: 'Get/set Sub level.',
led: 'Get/set/clear LED state.',
Expand Down Expand Up @@ -180,6 +188,18 @@ Commands:
${usage.speechEnhancement}
${description.speechEnhancement}
${usage.surroundEnable}
${description.surroundEnable}
${usage.tvLevel}
${description.tvLevel}
${usage.musicLevel}
${description.musicLevel}
${usage.musicPlaybackFull}
${description.musicPlaybackFull}
${usage.subEnable}
${description.subEnable}
Expand Down Expand Up @@ -518,6 +538,52 @@ Parameters:
${b('off')}
Clear speech enhancement.`,
surroundEnable: `${description.surroundEnable}
Usage: ${b('zp')} ${usage.surroundEnable}
Parameters:
${b('-h')}, ${b('--help')}
Print this help and exit.
${b('on')}
Enable surround speakers.
${b('off')}
Disable surround speakers.`,
tvLevel: `${description.tvLevel}
Usage: ${b('zp')} ${usage.tvLevel}
Parameters:
${b('-h')}, ${b('--help')}
Print this help and exit.
${u('level')}
Set TV surround level to ${u('level')} (from -15 to 15).`,
musicLevel: `${description.musicLevel}
Usage: ${b('zp')} ${usage.musicLevel}
Parameters:
${b('-h')}, ${b('--help')}
Print this help and exit.
${u('level')}
Set music surround level to ${u('level')} (from -15 to 15).`,
musicPlaybackFull: `${description.musicPlaybackFull}
Usage: ${b('zp')} ${usage.musicPlaybackFull}
Parameters:
${b('-h')}, ${b('--help')}
Print this help and exit.
${b('on')}
Set music playback to full.
${b('off')}
Set music playback to ambient.`,
subEnable: `${description.subEnable}
Usage: ${b('zp')} ${usage.subEnable}
Expand Down Expand Up @@ -1107,6 +1173,14 @@ class Main extends homebridgeLib.CommandLineTool {

async speechEnhancement (...args) { return this.onOffCommand('SpeechEnhancement', ...args) }

async surroundEnable (...args) { return this.onOffCommand('SurroundEnable', ...args) }

async tvLevel (...args) { return this.valueCommand('TvLevel', -15, 15, ...args) }

async musicLevel (...args) { return this.valueCommand('MusicLevel', -15, 15, ...args) }

async musicPlaybackFull (...args) { return this.onOffCommand('MusicPlaybackFull', ...args) }

async subEnable (...args) { return this.onOffCommand('SubEnable', ...args) }

async subLevel (...args) { return this.valueCommand('SubLevel', -15, 15, ...args) }
Expand Down

0 comments on commit 6410d24

Please sign in to comment.