-
-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Metric weather units and sonos testing
- Loading branch information
1 parent
7925efb
commit ea77106
Showing
15 changed files
with
573 additions
and
765 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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
const request = require("request"); | ||
const { Sonos } = require("sonos"); | ||
|
||
class sono { | ||
constructor(log, config, api) { | ||
this.log = log; | ||
this.config = config; | ||
this.api = api; | ||
this.devices = []; | ||
const DeviceDiscovery = require("sonos").AsyncDeviceDiscovery; | ||
let discovery = new DeviceDiscovery(); | ||
discovery.discover().then((device, model) => { | ||
this.devices.push(new Sonos(device.host)); | ||
}); | ||
} | ||
get_status() { | ||
for (var device in this.devices) { | ||
device.currentState().then((state) => { | ||
if (state) { | ||
device.currentTrack().then((track) => { | ||
return track; | ||
}); | ||
} | ||
}); | ||
} | ||
} | ||
} | ||
|
||
module.exports = sono; |
Oops, something went wrong.