Skip to content
Permalink
Browse files

feat: add space between roku name and switch names

This makes the names a bit more ergonomic in the home app. Instead of
RokuPower, it will now be Roku Power, etc.
  • Loading branch information
Brian Schlenker authored and bschlenk committed Nov 23, 2018
1 parent 042c3b7 commit 37bc85a25c2df8038e99749854049d6d0d32092d
Showing with 7 additions and 7 deletions.
  1. +3 −3 src/__tests__/homebridge-roku.test.js
  2. +4 −4 src/homebridge-roku.js
@@ -115,7 +115,7 @@ describe('homebridge-roku', () => {
});

it('should have proper service and name set', () => {
expect(powerSwitch.service).toEqual('RokuPower');
expect(powerSwitch.service).toEqual('Roku Power');
expect(powerSwitch.name).toEqual('Power');
});

@@ -196,7 +196,7 @@ describe('homebridge-roku', () => {
});

it('should have the proper service and name', () => {
expect(keySwitch.service).toEqual(`Roku${keypress}`);
expect(keySwitch.service).toEqual(`Roku ${keypress}`);
expect(keySwitch.name).toEqual(keypress);
});

@@ -241,7 +241,7 @@ describe('homebridge-roku', () => {
});

it('should have proper service and name', () => {
expect(channelSwitch.service).toEqual(`Roku${channel}`);
expect(channelSwitch.service).toEqual(`Roku ${channel}`);
expect(channelSwitch.name).toEqual(`${channel}`);
});

@@ -49,7 +49,7 @@ class RokuAccessory {
}

setupSwitch() {
const switch_ = new Service.Switch(`${this.name}Power`, 'Power');
const switch_ = new Service.Switch(`${this.name} Power`, 'Power');

switch_
.getCharacteristic(Characteristic.On)
@@ -67,7 +67,7 @@ class RokuAccessory {

setupMute() {
// Speaker seems to be unsupported, emmulating with a switch
const volume = new Service.Switch(`${this.name}Mute`, 'Mute');
const volume = new Service.Switch(`${this.name} Mute`, 'Mute');

volume
.getCharacteristic(Characteristic.On)
@@ -99,7 +99,7 @@ class RokuAccessory {

setupVolume(key) {
const volume = new Service.Switch(
`${this.name}${key.command}`,
`${this.name} ${key.command}`,
key.command,
);

@@ -123,7 +123,7 @@ class RokuAccessory {
}

setupChannel(name, id) {
const channel = new Service.Switch(`${this.name}${name}`, name);
const channel = new Service.Switch(`${this.name} ${name}`, name);

channel
.getCharacteristic(Characteristic.On)

0 comments on commit 37bc85a

Please sign in to comment.
You can’t perform that action at this time.