Read the statement by Michael Teeuw here.
-
I did a replacement on the Station names, because “Shell” is typically naming there stations after the Street name.
I fixed the City name to have only the first Letter in uppercase.
How can i remove the " null" part, which is occuring at JET stations,
or how can i tidy up the street names? (every seperate word starting with an uppercase)of course i can start with a list of the complete string that should be replaced, but there might be another option.
Thanks :)
-
- null @jets is propably that they inserted the house number in the street name and the house number value returns null
- for the street names i would split at the space character and then for each array item charAt(0).toUpperCase() and the rest of the string lowercase and finally join them together
-
I added checks for house numbers==null and splitted the street names.
Also the Brand names starting with (star,ESSO,Aral were replaced automatically)
(Shell and no-name stations are a special case, so i need to handle them individually)But, there is still another special case:
Streetnames with " " or “-” should be splitted, but no housenumbers (from JET :D ).
How can i avoid splitting numbers:
This is the section that does the splitting
words = str.toLowerCase().split(/-| /);
can be found here in total:
https://github.com/Dom1n1c/MMM-Fuel/blob/master/MMM-Fuel.js -
@Dom1n1c I commented on your changes
-
Is it possible to choose other typs of fuel like non-leaded supergrade plus petrol or premium?
-
@reaper81 the api only provides diesel e5 and e10 sorry
-
Hi
If I take the example with a matching token,
“Node serveronly” does not start.Loading config …
Loading module helpers …
WARNING! Could not validate config file. Please correct syntax errors. Starting with default configuration.
Loading module helpers …
Whoops! There was an uncaught exception…
[SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode]
MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issuesvar config = {
port: 8070,
ipWhitelist: [“127.0.0.1”, “::ffff:127.0.0.1”, “::1”, “192.168.1.22”],language: 'de', timeFormat: 24, units: 'metric',modules: [
{
module: ‘MMM-Fuel’,
position: ‘top_right’,
config: {
api_key: ‘f9fXXXXXXX’,
lat: 51.899177,
lng: 10.184662,
types: [‘diesel’],
}
}
]
}; -
@jayjay2017 please post your config without api keys or check your config on jshint.com
-
@jayjay2017 sounds like your node version doesnt support es6 which node version are you using?
-
The version of node was the point. I had Version 4.2.6, now updated to V7.7.2.
It works now.
Thank you very much.
-
Hi, have an issue with the shortenText parameter. When I use it, the address is max shorter(in px) then the name of the gas station. That’s a little bit anoying if more then one station is shown from the big companies and I can’t see the complete address, even if there is still enough place. Any idea, how I can change it? In the custom.css for example.

-
@sindbad6 looks strange, your name gets cut after 35 chars and your address after ~19 can you send me your geo data you’re using in config as a private message?
-
@strawberry-3.141 Sorry, I’m a complete newbie and can’t see how to send a private message. I tried it over the chat button. I hope you meant this.
-
@sindbad6 do a
git pullin~/MagicMirror/modules/MMM-Fuel -
@strawberry-3.141 Thanks a lot. That’s much better.
-
A great modul!!
What should I do to see the map? I have google maps API, but I don’t know where to add it.
-
@Stabber Currently the map can only be shown with my voice module https://github.com/fewieden/MMM-voice
-
Hi, I made a change in my MM-Fuel.js to implement an additional parameter for shortening the address of a gas station. It is not a big thing, but I would like if it would be integrated in the repository. The point is, I never have done it before. In between I got an account at github, but know? Can somebody give me a link where I can find belonging infos?
-
@sindbad6 in short:
- fork the repository
- make your changes
- push them to the fork
- create a pull request
-
@strawberry-3.141 Ok, I did it now. I’m not sure if I did right. Please inform me if something was wrong. I’m a little bit surprised, to get the possibility to merge my changes.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login
