-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #420 from athombv/develop
mdim
- Loading branch information
Showing
11 changed files
with
197 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
'use strict'; | ||
|
||
const Homey = require('homey'); | ||
|
||
module.exports = Homey; |
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,5 @@ | ||
{ | ||
"name": "homey", | ||
"main": "index.js", | ||
"type": "commonjs" | ||
} |
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,14 @@ | ||
import Homey from 'homey'; | ||
|
||
class MyApp extends Homey.App { | ||
|
||
/** | ||
* onInit is called when the app is initialized. | ||
*/ | ||
async onInit() { | ||
this.log('MyApp has been initialized'); | ||
} | ||
|
||
} | ||
|
||
export default MyApp; |
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,49 @@ | ||
import Homey from 'homey'; | ||
|
||
class MyDevice extends Homey.Device { | ||
|
||
/** | ||
* onInit is called when the device is initialized. | ||
*/ | ||
async onInit() { | ||
this.log('MyDevice has been initialized'); | ||
} | ||
|
||
/** | ||
* onAdded is called when the user adds the device, called just after pairing. | ||
*/ | ||
async onAdded() { | ||
this.log('MyDevice has been added'); | ||
} | ||
|
||
/** | ||
* onSettings is called when the user updates the device's settings. | ||
* @param {object} event the onSettings event data | ||
* @param {object} event.oldSettings The old settings object | ||
* @param {object} event.newSettings The new settings object | ||
* @param {string[]} event.changedKeys An array of keys changed since the previous version | ||
* @returns {Promise<string|void>} return a custom message that will be displayed | ||
*/ | ||
async onSettings({ oldSettings, newSettings, changedKeys }) { | ||
this.log('MyDevice settings where changed'); | ||
} | ||
|
||
/** | ||
* onRenamed is called when the user updates the device's name. | ||
* This method can be used this to synchronise the name to the device. | ||
* @param {string} name The new name | ||
*/ | ||
async onRenamed(name) { | ||
this.log('MyDevice was renamed'); | ||
} | ||
|
||
/** | ||
* onDeleted is called when the user deleted the device. | ||
*/ | ||
async onDeleted() { | ||
this.log('MyDevice has been deleted'); | ||
} | ||
|
||
} | ||
|
||
export default MyDevice; |
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,34 @@ | ||
import Homey from 'homey'; | ||
|
||
class MyDriver extends Homey.Driver { | ||
|
||
/** | ||
* onInit is called when the driver is initialized. | ||
*/ | ||
async onInit() { | ||
this.log('MyDriver has been initialized'); | ||
} | ||
|
||
/** | ||
* onPairListDevices is called when a user is adding a device | ||
* and the 'list_devices' view is called. | ||
* This should return an array with the data of devices that are available for pairing. | ||
*/ | ||
async onPairListDevices() { | ||
return [ | ||
// Example device data, note that `store` is optional | ||
// { | ||
// name: 'My Device', | ||
// data: { | ||
// id: 'my-device', | ||
// }, | ||
// store: { | ||
// address: '127.0.0.1', | ||
// }, | ||
// }, | ||
]; | ||
} | ||
|
||
} | ||
|
||
export default MyDriver; |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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