5 Commits

Author SHA1 Message Date
f682c0e380 Added deployment script 2019-08-01 19:21:46 -04:00
14312908bf Added redundant matrix calls 2019-08-01 18:57:19 -04:00
152d73e9f9 Fixed UseMatrix being a string instead of boolean. This fixed listen to music activity. 2019-07-31 17:34:23 -04:00
727c8ceba7 Fixed issue where inputs weren't getting set. Possibly fixed incorrect tv issue. 2019-07-31 17:14:02 -04:00
39f4a7c1bc Enabled debugging support
# Conflicts:
#	src/DataProviders/HarmonyDataProvider.ts
2019-07-31 16:33:31 -04:00
7 changed files with 78 additions and 21 deletions

16
.vscode/launch.json vendored Normal file
View File

@ -0,0 +1,16 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"preLaunchTask": "build and install",
"program": "/Users/brandonwatson/.npm-global/bin/homebridge",
"sourceMaps": true,
}
]
}

17
.vscode/tasks.json vendored Normal file
View File

@ -0,0 +1,17 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "build",
"problemMatcher": []
},
{
"type": "shell",
"label": "build and install",
"command": "npm run build&&sudo npm install -g --unsafe-perm ."
}
]
}

View File

@ -1,7 +1,7 @@
{
"bridge": {
"name": "Homebridge",
"username": "CC:22:3D:E3:CE:42",
"username": "CC:22:3D:E3:CE:74",
"port": 51826,
"pin": "031-45-154"
},
@ -58,11 +58,11 @@
"DeviceSetupList": [
{
"DeviceName": "LG TV",
"Input": "HDMI1"
"Input": "Hdmi1"
},
{
"DeviceName": "JVC AV Receiver",
"Input": "DVD"
"Input": "Dvd"
},
{
"DeviceName": "Chromecast",
@ -83,11 +83,11 @@
},
{
"DeviceName": "LG TV",
"Input": "HDMI1"
"Input": "Hdmi1"
},
{
"DeviceName": "JVC AV Receiver",
"Input": "DVD"
"Input": "Dvd"
}
],
"VolumeDevice": "JVC AV Receiver",
@ -104,11 +104,11 @@
},
{
"DeviceName": "LG TV",
"Input": "HDMI1"
"Input": "Hdmi1"
},
{
"DeviceName": "JVC AV Receiver",
"Input": "DVD"
"Input": "Dvd"
}
],
"VolumeDevice": "JVC AV Receiver",
@ -125,11 +125,11 @@
},
{
"DeviceName": "LG TV",
"Input": "HDMI1"
"Input": "Hdmi1"
},
{
"DeviceName": "JVC AV Receiver",
"Input": "DVD"
"Input": "Dvd"
}
],
"VolumeDevice": "JVC AV Receiver",
@ -142,7 +142,7 @@
"DeviceSetupList": [
{
"DeviceName": "JVC AV Receiver",
"Input": "DVD"
"Input": "CD"
}
],
"VolumeDevice": "JVC AV Receiver",
@ -160,7 +160,7 @@
"DeviceSetupList": [
{
"DeviceName": "Vizio TV",
"Input": "HDMI1"
"Input": "Hdmi1"
},
{
"DeviceName": "Harman Kardon AV Receiver",
@ -185,7 +185,7 @@
},
{
"DeviceName": "Vizio TV",
"Input": "HDMI1"
"Input": "Hdmi1"
},
{
"DeviceName": "Harman Kardon AV Receiver",
@ -206,11 +206,11 @@
},
{
"DeviceName": "Vizio TV",
"Input": "HDMI1"
"Input": "Hdmi1"
},
{
"DeviceName": "Harman Kardon AV Receiver",
"Input": "DVD"
"Input": "Dvd"
}
],
"VolumeDevice": "Harman Kardon AV Receiver",
@ -227,7 +227,7 @@
},
{
"DeviceName": "Vizio TV",
"Input": "HDMI1"
"Input": "Hdmi1"
},
{
"DeviceName": "Harman Kardon AV Receiver",
@ -253,7 +253,7 @@
},
{
"DeviceName": "Westinghouse TV",
"Input": "HDMI1"
"Input": "Hdmi1"
}
],
"VolumeDevice": "Westinghouse TV",
@ -270,7 +270,7 @@
},
{
"DeviceName": "Westinghouse TV",
"Input": "HDMI1"
"Input": "Hdmi1"
}
],
"VolumeDevice": "Westinghouse TV",
@ -283,7 +283,7 @@
"DeviceSetupList": [
{
"DeviceName": "Westinghouse TV",
"Input": "HDMI1"
"Input": "Hdmi1"
},
{
"DeviceName": "Microsoft Xbox One",

21
deploy.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/bash
remote_user="bmw"
remote_server="192.168.1.31"
deploy_location="/home/bmw/homebridge-harmony-control"
homebridge_location="/var/lib/homebridge/"
#copy files to remote machine
scp -r bin $remote_user@$remote_server:$deploy_location
scp -r src $remote_user@$remote_server:$deploy_location
scp package.json $remote_user@$remote_server:$deploy_location
#install package
ssh -t $remote_user@$remote_server "sudo npm install -g --unsafe-perm $deploy_location"
#restart service
ssh -t
ssh -t $remote_user@$remote_server "sudo systemctl restart homebridge.service"
ssh -t $remote_user@$remote_server "sudo systemctl status homebridge.service"
echo done
exit

View File

@ -123,8 +123,8 @@ class HarmonyDataProvider {
activity.deviceSetupItems.map(async (value: DeviceSetupItem) => {
let device: IDevice = this.getDeviceFromName(value.deviceName);
if (device && device.supportsCommand(`Input ${value.input}`)) {
let command: string = device.getCommand(`Input ${value.input}`);
if (device && device.supportsCommand(`Input${value.input}`)) {
let command: string = device.getCommand(`Input${value.input}`);
await this.sendCommand(command);
}
})
@ -142,8 +142,10 @@ class HarmonyDataProvider {
//Route hdmi
if (matrixDevice.supportsCommand(inputCommandName) && matrixDevice.supportsCommand(outputCommandName)) {
await this.sendCommand(matrixDevice.getCommand(outputCommandName));
await this.sendCommand(matrixDevice.getCommand(inputCommandName));
await this.sendCommand(matrixDevice.getCommand(outputCommandName));
await this.sendCommand(matrixDevice.getCommand(inputCommandName));
}
}

View File

@ -133,7 +133,7 @@ class HarmonyMatrixPlatform {
controlDeviceId: configActivity["ControlDevice"],
outputDeviceId: configActivity["OutputDevice"],
displayName: configActivity["DisplayName"],
useMatrix: configActivity["UseMatrix"],
useMatrix: configActivity["UseMatrix"] === "true" ? true : false,
deviceList: devices
}));
this.log(`INFO - Added activity '${configActivity["DisplayName"]}'`);

View File

@ -5,6 +5,7 @@
"declaration": true,
"outDir": "./bin",
"strict": true,
"sourceMap": true,
},
"include": [
"src"