@lavolp3 are you browsing to http://localhost:8080/MMM-Strava/auth/ and using the authorisation process there? If so, where is the bad request being displayed?
It should look something like this:
@lavolp3 are you browsing to http://localhost:8080/MMM-Strava/auth/ and using the authorisation process there? If so, where is the bad request being displayed?
It should look something like this:
@ianperrin said in [Help!] svg Graph in module MMM-Strava:
However, I’ve recently been implementing new authentication flow in the develop branch.
See https://forum.magicmirror.builders/topic/457/mmm-strava/37 for more details on the new beta version ;)
@zerodegree79 , @Val07300, @ctatos (and others I may have missed).
A new (beta) version of the module with support for Strava’s new authentication flow is available.
Much of the code for the module has been re-written/re-factored and includes a number of changes to the original module including
chart
mode now supports either the recent
and ytd
values in the period
optiontable
mode are configurable via the stats
optionclient_id
and client_secret
must be included in the config in place of the deprecated strava_id
and access_token
options. The legacy options can still be used, but will trigger an alert on the mirror when the module is loaded and it is recommended they are removed.Please note - the module no longer supports multiple athlete id’s in one module instance. Multiple instances can be added to the config file to achieve similar results.
This functionality is only available in the develop branch of the github repository at this time. Once any issues have been fixed, the master branch will be updated.
To test the refresh token functionality and the new authentication flow in the Magic Mirror, you need to update the module using the following steps:
cd ~/MagicMirror/modules/MMM-Strava
git checkout develop && git pull
npm install --production
strava_id
and access_token
optionsclient_id
and client_secret
options. The values for these options should be copied from the My API Application page in your Strava profileWhen updated correctly, the module should display a Client id unauthorised message. The module can be authorised using the following steps:
ipWhitelist
in the Magic Mirror@lavolp3 I found that the only way to create an SVG via the DOM was to use document.createElementNS
. There’s a helper function (poorly named getNode
) in the current master branch which supports the creation of an SVG tag with attributes (e.g. getNode("svg", {width: 115, height: 68, class: 'chart'})
However, I’ve recently been implementing new authentication flow in the develop branch. Alongside that, I’ve switched to using nunjucks templating. There’s quite a few changes, including the chart
mode now supporting the period
option (i.e. recent
, ytd
) and the ability to add multiple instances of the module to the mirror which could (should?) make implementing new views easier.
My suggestion would be to add a new mode (progress
) to the module along with a new template (templates\MMM-Strava.progress.njk
) and start from there.
Let me know how you get on and I can assist where possible.
Not as yet I’m afraid.
Hoping to work on it in the coming weeks - work and other commitments permitting.
PRs welcome from those who might have the know how 😉
@ctatos could you send me a pm with details of the script and cron setup you are using?
@lkthomas okay, a couple of things to check
config.js
file.With the config above place at the end of modules
section you should see the following lines in the log.
MMM-ModuleScheduler is removing all scheduled jobs
MMM-ModuleScheduler received CREATE_GLOBAL_SCHEDULE
MMM-ModuleScheduler is creating a global schedule for all modules using "0 6 * * *" and "0 22 * * *" with dim level 20
MMM-ModuleScheduler has created the global schedule for all modules
MMM-ModuleScheduler will next show all modules at Sun Jan 13 2019 06:00:00 GMT+0000 (UTC)
MMM-ModuleScheduler will next dim all modules at Sat Jan 12 2019 22:00:00 GMT+0000 (UTC)
Whilst testing, you could use the following config to toggle the brightness more frequently (i.e. every two minutes):
{
module: 'MMM-ModuleScheduler',
config: {
global_schedule: {from: '0-59/4 * * * *', to: '2-59/4 * * * *', dimLevel: '20' },
}
},
Let us know how you get on.
@lkthomas take a look at MMM=ModuleScheduler. It contains a method for dimming modules.
Once installed, adding something like this should to your config.js
should work
{
module: 'MMM-ModuleScheduler',
config: {
// SHOW ALL MODULES AT FULL BRIGHTNESS AT 06:00 AND DIM THEM TO 20% AT 22:00
global_schedule: {from: '0 6 * * *', to: '0 22 * * *', dimLevel: '20' },
}
},
@zdenek the module currently only supports font awesome 4 so try video-camera
.
Unfortunately, raspberry-pi
is only available in font awesome 5 so you won’t be able to use it just yet. However, once the fix to an issue with font awesome compatibility has been released, which is expected in version 2.7, you should be able to use all font awesome 5 free icons
You should avoid editing the module files and place your configuration in the config.js file - check the readme file for installation, update and configuration notes
Once you’ve reverted your changes to the module files, pull
the latest version of the module and make sure config.js
is correctly configured.
There is no need to add anything special to the config to include virtual
activities as these will be rolled up into the ride
and run
totals in the chart like the table mode and your dashboard on the Strava website