-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update MMM-JsonTable.js #93
Changes from all commits
fac7e36
2998674
048e323
cc3dbd2
752faa5
88e5db6
68402e0
2333e7a
32e4e26
d911b71
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,8 @@ | ||
# MMM-JsonTable | ||
|
||
All credit to @timdows her. | ||
just added the functionality to dive in to a second array | ||
|
||
A module for the [MagicMirror²](https://github.com/MichMich/MagicMirror) project which creates a table filled with a list gathered from a json request. | ||
|
||
All the variables of the objects in the array are represented by a table column. | ||
|
@@ -237,13 +240,95 @@ | |
position: 'top_right', | ||
header: 'HouseDB Kwh Statistics', | ||
config: { | ||
url: 'https://xyz/abc/get.json', | ||
|
||
url: 'https://xyz/abc/get.json', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What for is this change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Readme should not be pulled |
||
arrayName: 'deviceKwhUsages', | ||
descriptiveRow: '<tr><td>Name</td><td>Today</td><td>ThisWeek</td><td>LastWeek</td><td>ThisMonth</td><td>LastMonth</td></tr>' | ||
} | ||
} | ||
``` | ||
|
||
Getting the data under "Forbrok" | ||
|
||
``` | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please add |
||
{ | ||
"status": "success", | ||
"url": "/soppel", | ||
"method": "GET", | ||
"data": [ | ||
{ | ||
"Forbrok": [ | ||
{ | ||
"deviceName": "Power consumption", | ||
"currentValue": "Now: 3009 watts", | ||
"currentTarget": " ", | ||
"lastUpdate": "Limit: 5000 watt" | ||
}, | ||
{ | ||
"deviceName": "Varmepumpe", | ||
"currentValue": "Now:25.8°C,", | ||
"currentTarget": "Target:21°C,", | ||
"lastUpdate": "Home override: true" | ||
}, | ||
{ | ||
"deviceName": "Hotwater", | ||
"currentValue": "Now:44.38°C,", | ||
"currentTarget": "Last heat complete", | ||
"lastUpdate": "66.9 : 05:46 @ 19-12-2022 " | ||
}, | ||
{ | ||
"deviceName": "Last update", | ||
"currentValue": " ", | ||
"currentTarget": " ", | ||
"lastUpdate": "23:27 19-12-2022" | ||
} | ||
] | ||
}, | ||
{ | ||
"mren": [ | ||
{ | ||
"avfallstype": "Restavfall", | ||
"dato": "30-12-2022" | ||
}, | ||
{ | ||
"avfallstype": "Matavfall", | ||
"dato": "30-12-2022" | ||
}, | ||
{ | ||
"avfallstype": "Papiravfall", | ||
"dato": "30-12-2022" | ||
}, | ||
{ | ||
"avfallstype": "Plastemballasje", | ||
"dato": "30-12-2022" | ||
}, | ||
{ | ||
"avfallstype": "Glass- og metallemballasje", | ||
"dato": "30-12-2022" | ||
} | ||
] | ||
} | ||
] | ||
} | ||
``` | ||
|
||
Configuration: | ||
|
||
```javascript | ||
{ | ||
module: 'MMM-JsonTable', | ||
position: 'top_left', | ||
header: 'Homey Local API', | ||
config: { | ||
url: 'https://xyz/abc/get.json', | ||
arrayName: 'Data', | ||
arrayName2: 'Forbrok', | ||
|
||
|
||
} | ||
} | ||
``` | ||
|
||
## Developer hints | ||
|
||
Please use `npm run test` before doing a PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Credits are good and would be appropriate for a fork. But here I don't think it should be listed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry never ment readme for PR