@sdetweil said in How difficult would it be to change the data an existing module receives?:
@Tippon you can clone (fork) the module and add on what you want…
Sorry, I should have clarified - I know that I can fork the module, but I don’t have the skills or knowledge to keep up with any changes that might be made to the original. If there was a security update, for example, I wouldn’t know how to integrate that into my fork. Considering the dates of the last changes though, that might not be an issue in this case.
@sdetweil said in How difficult would it be to change the data an existing module receives?:
there are two parts of the module… the browser/ui part MMM-Fitbit2.js
and the helper, node_helper.js
the MMM-Fitbit2.js cannot access hardware or files directly, so it has to call the helper
so, you could add on access to the spreadsheet (csv)
and send that data back as part of the response… the front end would never know
one of my modules uses a csv
in the node_helper
(you have to npm install csvtojson in the module folder to be able to use it)
const cvt = require("csvtojson");
and then
cvt().fromFile(payload.tmpfile) // input xls // changed to tmpfile
.subscribe((jsonObj, index) => {
// handle each row
})
So, ignoring any possible updates for now, I could edit the node_helper.js and basically trick the rest of the module into using my chosen data instead? That sounds great, thanks :)
I’ve found some apps that share data between Fitbit and Google Fit, so depending on how well they all work together, this might be a bit easier than I thought.
I’ve just discovered a problem with the Fitbit data though. Until recently, MMM-Fitbit2 would pull a lot of my data and display it on my mirror. Today though it’s not displaying my calories in figure. Google has taken over Fitbit, and recently forced a change of login, from Fitbit’s old system to a Google login. I’m not sure if this problem started at the same time, or if there’s been a change in the API. I’m pottering around trying to figure it out, but it might take me a while to figure out what I’m doing, never mind what Fitbit / Google are doing >.<
Thanks as always for your help :)