Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
73 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#!/bin/bash | ||
|
||
echo "adding homebridge-plugin-ai" | ||
npm add file:/var/lib/homebridge-plugin-ai | ||
echo "adding homebridge-plugin-automation" | ||
npm add file:/var/lib/homebridge-plugin-automation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
export const PLATFORM_SCRIPT = ` | ||
const automation = { | ||
services: []; | ||
handleMessage(message) { | ||
if (message.type === "deviceStatusChange") { | ||
onMessage(message.data); | ||
const service = automation.services.find(s => s.uniqueId === message.data.uniqueId); | ||
if (service) { | ||
Object.assign(service, message.data); | ||
} | ||
} | ||
if (message.type === "deviceList") { | ||
automation.services = message.data; | ||
} | ||
} | ||
set(serviceId, iid, value) { | ||
__host({ | ||
version: 1, | ||
type: "SetCharacteristic", | ||
data: { | ||
serviceId, | ||
iid, | ||
value, | ||
}, | ||
}); | ||
} | ||
} | ||
`; |