Skip to content
This repository has been archived by the owner on May 30, 2022. It is now read-only.

Commit

Permalink
add configurable vehicle angle
Browse files Browse the repository at this point in the history
  • Loading branch information
hdurdle committed Jul 4, 2019
1 parent 91e60bc commit 5b23ffb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 3 additions & 1 deletion MMM-BMWConnected.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
Module.register('MMM-BMWConnected', {

defaults: {
apiBase: "https://www.bmw-connecteddrive.co.uk"
apiBase: "https://www.bmw-connecteddrive.co.uk",
refresh: 15,
vehicleAngle: 300
},

getStyles: function () {
Expand Down
10 changes: 6 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,7 @@ Enter these details in the config.js for your MagicMirror installation:
position: "top_right",
config: {
email: "email@example.com",
password: "myComplexPassword",
apiBase: "www.bmw-connecteddrive.co.uk",
refresh: 5
password: "myComplexPassword"
}
},

Expand Down Expand Up @@ -60,7 +58,11 @@ The module has a few configuration options:
</tr>
<tr>
<td><code>refresh</code></td>
<td>How often to refresh the data in minutes. <br /><br /><strong>Default: </strong><code>5</code> </td>
<td>How often to refresh the data in minutes. <br /><br /><strong>Default: </strong><code>15</code> </td>
</tr>
<tr>
<td><code>vehicleAngle</code></td>
<td>The angle of rotation for the car image. <br /><br /><strong>Default: </strong><code>300</code><br/>Between 0 and 350 in increments of 10.</td>
</tr>
</tbody>
</table>
Expand Down
2 changes: 1 addition & 1 deletion node_helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ module.exports = NodeHelper.create({
try {
var json = JSON.parse(data);
var angleUrls = json.angleUrls;
var picked = angleUrls.find(o => o.angle === 300);
var picked = angleUrls.find(o => o.angle === self.config.vehicleAngle);
} catch (err) {
console.error("Failed to parse data " + data + ", error " + err);
}
Expand Down

0 comments on commit 5b23ffb

Please sign in to comment.