-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Removes hue module and switches to axios (patch)
- Loading branch information
Showing
8 changed files
with
64 additions
and
45 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 was deleted.
Oops, something went wrong.
This file was deleted.
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
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,13 @@ | ||
const axios = require('axios') | ||
const config = require('../config.json') | ||
|
||
async function addUser () { | ||
// const buttonUrl = `http://${config.bridge}/api` | ||
const userUrl = `http://${config.bridge}/api` | ||
// const { data: button } = await axios.put(buttonUrl, {linkbutton: true}) | ||
// console.log(JSON.stringify(button, null, 2)) | ||
const { data: user } = await axios.post(userUrl, {devicetype: 'luftstatus'}) | ||
console.log(JSON.stringify(user, null, 2)) | ||
} | ||
|
||
addUser() |
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,6 @@ | ||
const axios = require('axios') | ||
const upnpUrl = 'http://www.meethue.com/api/nupnp' | ||
|
||
axios(upnpUrl).then(result => { | ||
console.log(JSON.stringify(result.data, null, 2)) | ||
}).catch(console.error) |
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,7 @@ | ||
const axios = require('axios') | ||
const config = require('../config.json') | ||
const url = `http://${config.bridge}/api/${config.username}/lights` | ||
|
||
axios.get(url).then(result => { | ||
console.log(JSON.stringify(result.data, null, 2)) | ||
}).catch(console.error) |