From dab143f6fdc0b459101b727458943ca0d30c2dde Mon Sep 17 00:00:00 2001 From: Matt <927830+mattmattmatt@users.noreply.github.com> Date: Sun, 3 Feb 2019 15:05:36 -0800 Subject: [PATCH] feat: add more channels to input map Closes https://github.com/mattmattmatt/node-red-contrib-avr-pioneer/issues/2. Closes #2. --- README.md | 6 +++--- pioneer-avr-out.html | 2 +- src/PioneerAvrOut.js | 43 +++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index d841264..900aa82 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,9 @@ npm i node-red-contrib-avr-pioneer -S ## Usage -Provides two palette nodes – one to send control commands to a Pioneer AVR, and one to receive messages when receiver's state changes. +Currently provides one palette node – one to send control commands to a Pioneer AVR. -![](https://github.com/mattmattmatt/node-red-contrib-avr-pioneer/blob/master/tooling/nodes.png?raw=true) +![](https://cldup.com/T5692bE_OT.png) ### Output node @@ -37,7 +37,7 @@ Sets the state of the receiver. | `on` | Sets the `on` state where the value is `true` or `false` | | `muted` | Sets the `muted` state where the value is `true` or `false` | | `volume` | Sets the volume from `0` to `74`, or whatever your receiver's maximum is | -| `channel` | Sets the active input channel, must be one of `CD`, `TUNER`, `DVD`, `TV`, `SAT/CBL`, `VIDEO`, `DVR/BDR`, `IPOD/USB`, `BD`, `ADAPTER`, `NETRADIO`, `MEDIA SERVER`, `FAVORITE`, `GAME` | +| `channel` | Sets the active input channel, must be one of `PHONO`, `CD`, `TUNER`, `TAPE`, `DVD`, `TV`, `SAT/CBL`, `SAT`, `CBL`, `CABLE`, `VIDEO`, `MULTI CH IN`, `USB-DAC`, `VIDEO2`, `DVR/BDR`, `DVR`, `BDR`, `IPOD/USB`, `USB`, `IPOD`, `XM RADIO`, `HDMI1`, `HDMI2`, `HDMI3`, `HDMI4`, `HDMI5`, `HDMI6`, `BD`, `MEDIA GALLERY`, `SIRIUS`, `HDMI CYCLE`, `ADAPTER`, `HDMI7`, `HDMI8`, `NETRADIO`, `SIRIUSXM`, `PANDORA`, `MEDIA SERVER`, `MEDIA`, `FAVORITE`, `MHL`, `GAME`, `SPOTIFY`.
[See source](https://github.com/mattmattmatt/node-red-contrib-avr-pioneer/blob/master/src/PioneerAvrOut.js#L5) for more info on input codes. | #### Example payloads diff --git a/pioneer-avr-out.html b/pioneer-avr-out.html index dcc15d7..bb7857f 100644 --- a/pioneer-avr-out.html +++ b/pioneer-avr-out.html @@ -52,7 +52,7 @@

Inputs

payload.volume number
payload.channel enum
-
One of CD, TUNER, DVD, TV, SAT/CBL, VIDEO, DVR/BDR, IPOD/USB, BD, ADAPTER, NETRADIO, MEDIA SERVER, FAVORITE, GAME
+
One of PHONO, CD, TUNER, TAPE, DVD, TV, SAT/CBL, SAT, CBL, CABLE, VIDEO, MULTI CH IN, USB-DAC, VIDEO2, DVR/BDR, DVR, BDR, IPOD/USB, USB, IPOD, XM RADIO, HDMI1, HDMI2, HDMI3, HDMI4, HDMI5, HDMI6, BD, MEDIA GALLERY, SIRIUS, HDMI CYCLE, ADAPTER, HDMI7, HDMI8, NETRADIO, SIRIUSXM, PANDORA, MEDIA SERVER, MEDIA, FAVORITE, MHL, GAME, SPOTIFY

Example inputs

diff --git a/src/PioneerAvrOut.js b/src/PioneerAvrOut.js index 916bc19..a5fcefa 100644 --- a/src/PioneerAvrOut.js +++ b/src/PioneerAvrOut.js @@ -3,44 +3,87 @@ import { isJson, parse, random } from './utils'; const MSG_INTERVAL_MS = 180; const channelToInput = { + PHONO: '00', CD: '01', TUNER: '02', + TAPE: '03', DVD: '04', TV: '05', 'SAT/CBL': '06', SAT: '06', + CBL: '06', CABLE: '06', VIDEO: '10', + 'MULTI CH IN': '12', + 'USB-DAC': '13', + VIDEO2: '14', 'DVR/BDR': '15', DVR: '15', BDR: '15', 'IPOD/USB': '17', USB: '17', IPOD: '17', + 'XM RADIO': '18', + HDMI1: '19', + HDMI2: '20', + HDMI3: '21', + HDMI4: '22', + HDMI5: '23', + HDMI6: '24', BD: '25', + 'MEDIA GALLERY': '26', + SIRIUS: '27', + 'HDMI CYCLE': '31', ADAPTER: '33', + HDMI7: '34', + HDMI8: '35', NETRADIO: '38', + SIRIUSXM: '40', + PANDORA: '41', 'MEDIA SERVER': '44', MEDIA: '44', FAVORITE: '45', + MHL: '48', GAME: '49', + SPOTIFY: '57', }; const inputToChannel = { + '00': 'PHONO', '01': 'CD', '02': 'TUNER', + '03': 'TAPE', '04': 'DVD', '05': 'TV', '06': 'SAT/CBL', '10': 'VIDEO', + '12': 'MULTI CH IN', + '13': 'USB-DAC', + '14': 'VIDEO2', '15': 'DVR/BDR', '17': 'IPOD/USB', + '18': 'XM RADIO', + '19': 'HDMI1', + '20': 'HDMI2', + '21': 'HDMI3', + '22': 'HDMI4', + '23': 'HDMI5', + '24': 'HDMI6', '25': 'BD', + '26': 'MEDIA GALLERY', + '27': 'SIRIUS', + '31': 'HDMI CYCLE', '33': 'ADAPTER', + '34': 'HDMI7', + '35': 'HDMI8', '38': 'NETRADIO', + '40': 'SIRIUSXM', + '41': 'PANDORA', '44': 'MEDIA SERVER', '45': 'FAVORITE', + '48': 'MHL', '49': 'GAME', + '57': 'SPOTIFY', }; export default function PioneerAvrOut(RED) {