MagicMirror² v2.12.0 is available! For more information about this release, check out this topic.

Syntax Error.



  • And here Is my next question 😃 . I have this module but when I start my MagicMirror2 I get this message : " Please create a config file." Here is my code :

    {
    module: “MMM-WeeklySchedule”,
    position: “top_center”,
    header: “Stundenplan”,
    config: {
    schedule: {
    timeslots: [ “8:00”, “8:30”, “10:00”, “11:40”, “11:50” “13:00” “14:00” “14:45” “16:00”],
    lessons: {
    Mo: [ “GA”, "LZ - ", “Pause (30)”, “1 FS”, “2 FS”, “Pause (60)”, “LB”, “3 FS”, “Feierabend”],
    Di: [ “GA”, "LZ - ", “Pause (30)”, “1 FS”, “2 FS”, “Pause (60)”, “LB”, “3 FS”, “Feierabend”],
    Mi: [ “GA”, "LZ - ", “Pause (30)”, “1 FS”, “2 FS”, “Pause (60)”, “LB”, “3 FS”, “Feierabend”],
    Do: [ “GA”, "LZ - ", “Pause (30)”, “1 FS”, “2 FS”, “Pause (60)”, “LB”, “3 FS”, “Feierabend”],
    Fr: [ “GA”, "LZ - ", “Pause (30)”, “1 FS”, “2 FS”, “Pause (60)”, “LB”, “3 FS”, “Feierabend”],

            }
        },
        updateInterval: 1 * 60 * 60 * 1000, // every hour
        showNextDayAfter: 22:00
    

    },

    I´m sorry that the code looks so strange but I dont know how to do it right.


  • Module Developer

    @Nico-Biester
    There are some mistakes in your module config:

    • wrong quotes, you use instead of " (are you using mac to edit config.js?)
    • missing commas (in lessons, after 11:50)
    • missing brackets and/or bracket on the wrong position
    • wrong translations, you cant translate mon:to Mo:, as the module is looking for the array name of mon:
    • general advice: always use brackets in pair (every bracket which opens, has to close somewhere)

    This code shoud work:

    {
                module: "MMM-WeeklySchedule",
                position: "top_center",
                header: "Stundenplan",
                config: {
                    schedule: {
                        timeslots: [ "8:00", "8:30", "10:00", "11:40", "11:50" ,"13:00", "14:00", "14:45", "16:00"],
                        lessons: {
                            mon: [ "GA", "LZ - ", "Pause (30)", "1 FS", "2 FS", "Pause (60)", "LB", "3 FS", "Feierabend"],
                            tue: [ "GA", "LZ - ", "Pause (30)", "1 FS", "2 FS", "Pause (60)", "LB", "3 FS", "Feierabend"],
                            wed: [ "GA", "LZ - ", "Pause (30)", "1 FS", "2 FS", "Pause (60)", "LB", "3 FS", "Feierabend"],
                            thu: [ "GA", "LZ - ", "Pause (30)", "1 FS", "2 FS", "Pause (60)", "LB", "3 FS", "Feierabend"],
                            fri: [ "GA", "LZ - ", "Pause (30)", "1 FS", "2 FS", "Pause (60)", "LB", "3 FS", "Feierabend"],
                                },
                            updateInterval: 1 * 60 * 60 * 1000, // every hour
                            showNextDayAfter: "22:00"
                        },
                },
            },
    

    AxLED



  • @axled said in Syntax Error.:

    {
    module: “MMM-WeeklySchedule”,
    position: “top_center”,
    header: “Stundenplan”,
    config: {
    schedule: {
    timeslots: [ “8:00”, “8:30”, “10:00”, “11:40”, “11:50” ,“13:00”, “14:00”, “14:45”, “16:00”],
    lessons: {
    mon: [ “GA”, "LZ - ", “Pause (30)”, “1 FS”, “2 FS”, “Pause (60)”, “LB”, “3 FS”, “Feierabend”],
    tue: [ “GA”, "LZ - ", “Pause (30)”, “1 FS”, “2 FS”, “Pause (60)”, “LB”, “3 FS”, “Feierabend”],
    wed: [ “GA”, "LZ - ", “Pause (30)”, “1 FS”, “2 FS”, “Pause (60)”, “LB”, “3 FS”, “Feierabend”],
    thu: [ “GA”, "LZ - ", “Pause (30)”, “1 FS”, “2 FS”, “Pause (60)”, “LB”, “3 FS”, “Feierabend”],
    fri: [ “GA”, "LZ - ", “Pause (30)”, “1 FS”, “2 FS”, “Pause (60)”, “LB”, “3 FS”, “Feierabend”],
    },
    updateInterval: 1 * 60 * 60 * 1000, // every hour
    showNextDayAfter: “22:00”
    },
    },
    },

    Thanks for your help and your tips. It´s working very well!


Log in to reply