MagicMirror Forum
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • 3rd-Party-Modules
    • Donate
    • Discord
    • Register
    • Login
    1. Home
    2. htilburgs
    3. Posts
    A New Chapter for MagicMirror: The Community Takes the Lead
    Read the statement by Michael Teeuw here.
    Online
    • Profile
    • Following 0
    • Followers 3
    • Topics 25
    • Posts 238
    • Groups 0

    Posts

    Recent Best Controversial
    • RE: Need help for rewrite node_helper.js from 'request' to 'got'

      @sdetweil
      In the previous version with ‘request’ I used JSON.parse() and got the same results.
      The module works, but I didn’t know for sure if I used the correct approach.

      posted in Development
      htilburgsH
      htilburgs
    • RE: Need help for rewrite node_helper.js from 'request' to 'got'

      @sdetweil
      That I don’t understand.
      Is this a problem? What would be better?

      posted in Development
      htilburgsH
      htilburgs
    • RE: Need help for rewrite node_helper.js from 'request' to 'got'

      @sdetweil
      As far as I can see this works the correct way.
      Do you agree?

      posted in Development
      htilburgsH
      htilburgs
    • RE: Need help for rewrite node_helper.js from 'request' to 'got'

      @sdetweil

      I kept on searching and think I’ve found it.
      I didn’t use JSON.parse(), but simply put it in the result

          this.sendSocketNotification('MPT_RESULT', result.data.timings);
      

      It works, but I hope this is the right way.

      posted in Development
      htilburgsH
      htilburgs
    • RE: Need help for rewrite node_helper.js from 'request' to 'got'

      @sdetweil

      Oké, made a start.
      Changed my node_helper.js to:

      /*
      //-------------------------------------------
      MMM-MyPrayerTimes
      Copyright (C) 2019 - H. Tilburgs
      MIT License
      //-------------------------------------------
      */
      
      const NodeHelper = require('node_helper');
      
      module.exports = NodeHelper.create({
      
        start: function() {
                console.log("Starting node_helper for: " + this.name);
        },
      
       getMPT: function(url) {
              // Make a GET request using the Fetch API
              fetch(url)
              .then(response => {
              if (!response.ok) {
                throw new Error('Network response was not ok');
              }
              return response.json();
          })
          .then(result => {
          // Process the retrieved user data
          console.log(result);
          this.sendSocketNotification('MPT_RESULT', result);
        })
        .catch(error => {
          console.error('Error:', error);
        });
      },
      
      
        socketNotificationReceived: function(notification, payload) {
                  if (notification === 'GET_MPT') {
                  this.getMPT(payload);
                  }
        }
      });
      

      In the console I see the data:

      [2024-06-24 21:39:44.867] [LOG]   {
        code: 200,
        status: 'OK',
        data: {
          timings: {
            Fajr: '03:08',
            Sunrise: '05:21',
            Dhuhr: '13:40',
            Asr: '18:03',
            Sunset: '21:59',
            Maghrib: '21:59',
            Isha: '00:04',
            Imsak: '02:58',
            Midnight: '01:40',
            Firstthird: '00:26',
            Lastthird: '02:54'
          },
          date: {
            readable: '24 Jun 2024',
            timestamp: '1719257984',
            hijri: [Object],
            gregorian: [Object]
          },
          meta: {
            latitude: 51.48167,
            longitude: 5.66111,
            timezone: 'Europe/Amsterdam',
            method: [Object],
            latitudeAdjustmentMethod: 'ANGLE_BASED',
            midnightMode: 'STANDARD',
            school: 'STANDARD',
            offset: [Object]
          }
        }
      } 
      

      Only 1 problem, times are not displayed in de module

      484fd6c8-7285-4aef-ad68-9445b6a22fb2-image.png

      I know it has something to do with

      var result = JSON.parse(body).data.timings;               // 
      

      but I’m having troubles with this.
      When I replace body with result, I get an error.
      I’ve been looking for a solution for a few days now, but no result.

      Some help is appreciated ;-)

      posted in Development
      htilburgsH
      htilburgs
    • Need help for rewrite node_helper.js from 'request' to 'got'

      As we all know, the Nodejs module “request” is deprecated.
      I like to rewrite my node_helper.js module so request is not used anymore. Instead the Nodejs module “got” will be used.

      Module: https://github.com/htilburgs/MMM-MyPrayerTimes

      Can someone help me on my way?
      I’m not a developer and just do it for fun.

      posted in Development
      htilburgsH
      htilburgs
    • RE: MMM-CalendarExt3Agenda

      @sdetweil Yes! This works. Thanks

      posted in Utilities
      htilburgsH
      htilburgs
    • RE: MMM-CalendarExt3Agenda

      @MMRIZE I’ve tried, but no luck

      posted in Utilities
      htilburgsH
      htilburgs
    • RE: MMM-CalendarExt3Agenda

      @sdetweil thanks Sam for the extra explanation.

      posted in Utilities
      htilburgsH
      htilburgs
    • RE: MMM-CalendarExt3Agenda

      @MMRIZE
      I didn’t see it either in the documentation, my mistake. Thanks for the quick reply and fix. I’ll try when I’m at home.

      posted in Utilities
      htilburgsH
      htilburgs
    • RE: MMM-CalendarExt3Agenda

      @MMRIZE
      I know this, but I like to have 2 instances running.
      1 Calendar on the left and 1 MiniMonth on the right.
      On this way the CSS wil override the Calendar part of both parts.

      posted in Utilities
      htilburgsH
      htilburgs
    • RE: MMM-CalendarExt3Agenda

      Is there a way to only show MiniMonthCalendar and no calendars? I would like to run 2 instances of MMM-CalendarExt3 Agenda

      1. only show MiniMonthCalendar
      2. only show Calendar (no problem)
      posted in Utilities
      htilburgsH
      htilburgs
    • RE: MMM-CalendarExt3Agenda

      @htilburgs said in MMM-CalendarExt3Agenda:

      Is there a way to hide (not show) Yesterday, Today, Tomorrow, etc. and just show the day and date?

      Found it:
      in custom.css change

      .CX3A .relativeDay {
      display: none;
      }

      c830af2e-f2c0-4472-a6a5-1f9b6ae2fbca-image.png

      posted in Utilities
      htilburgsH
      htilburgs
    • RE: MMM-CalendarExt3Agenda

      Is there a way to hide (not show) Yesterday, Today, Tomorrow, etc. and just show the day and date?

      posted in Utilities
      htilburgsH
      htilburgs
    • RE: 2.25 language 'nl' not working

      @sdetweil @karsten13

      Message from MMM-OnSpotify.

      Its now fixed in V3.1.0, both the icon color change (now the helper css classes are loaded on a separated file), 
      and the clock translation error (locale settings were getting overwritten by the module instance of the moment library).
      

      Installed the update and problem solved.
      Thanks for helping!

      posted in Troubleshooting
      htilburgsH
      htilburgs
    • RE: 2.25 language 'nl' not working

      @sdetweil tried everything as told in the readme, but no luck. Currently disabled that module.

      posted in Troubleshooting
      htilburgsH
      htilburgs
    • RE: 2.25 language 'nl' not working

      @karsten13 @sdetweil
      So, restored ‘old’ version and update MM. No problem, only MMM-MyCalendar causes to stop MM. Disable MMM-MyCalendar and everything works fine. But…

      When I update MMM-OnSpotify, than the complete MM is in English instead of Dutch. Also the colors of the Icons in the Calendar Module change from Red to default.
      When I disable MMM-OnSpotify, than everything turns to normal (Dutch language and Red Icons in Calendar).

      Strange thing, now I’ve to look why MMM-OnSpotify causes this issue.

      posted in Troubleshooting
      htilburgsH
      htilburgs
    • RE: 2.25 language 'nl' not working

      @karsten13 @sdetweil
      I have a backup from 1 week ago so I first go back to that backup (previous version of MM), update again and see what happens. Everything started when MMM- MyCalandar stopped because of ‘fetch’ change and I didn’t realize that it wasn’t a problem from PiOS or MM.

      posted in Troubleshooting
      htilburgsH
      htilburgs
    • RE: 2.25 language 'nl' not working

      @sdetweil first manual, after that your script.

      posted in Troubleshooting
      htilburgsH
      htilburgs
    • 2.25 language 'nl' not working

      After the update to 2.25 everything is in English.
      My config.js is not changed.

      let config = {
              address : '0.0.0.0',
              port: 8080,
              basepath: "/",
              ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1", "::ffff:192.168.1.1/120", "192.168.1.1/24"],
              language: "nl",
              timeFormat: 24,
              units: "metric",
      

      Anybody an idea??

      posted in Troubleshooting
      htilburgsH
      htilburgs
    • 1
    • 2
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 8 / 12