Closed sdetweil closed 4 years ago
Hi, I cannot reproduce the problem. In my case the self.config.units
reads out the units from the config.js correctly. If I set the recommendation like you posted in the forum (thank you btw for helping others): var self = this
, then it will read out the defaults set in the MMM-Tado.js and not from the config.js.
My config.js looks like the following:
var config = {
...
units: "metric",
...
modules: [
...
{
module: 'MMM-Tado',
position: 'top_right',
header: 'My Home',
config: {
username: 'X',
password: 'X',
updateInterval: 300000,
}
},
...
]
};
Have the similar problem @WouterEekhout i cant switch to Celsius.
the problem is the code depends on an outside global variable self, at the time start: is called. and there is no assurance self is correctly set.
the global config variable IS set, and one doesn't need any prefixing pointer to use it
config.units would work
Thank you, so i have added config.units = metric in the config of tado. But that didn work /
@lordvalium I was talking about the one at the top of config.js, before the modules loop.
if the code removed the self. then it would work as he expected
no its not working
ok, i just installed Tado and changed the code in MMM-Tado.js from
this.config.units = self.config.units ;
to
this.config.units = config.units;
and used debug to verify that the correct value was picked up from the config file
one could also change all
self.config.units
to
config.units
as there is no need for the instance stored version
bug in the start routine
see https://forum.magicmirror.builders/topic/12914/mmm-tado-wrong-units/4?_=1590847553898