<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[DIY Module Displays Nothing]]></title><description><![CDATA[<p dir="auto">Hi There - I’ve been working on a module to display the “Now Playing” info (song, artist, cover-art, time remaining) from a particular player of my Lyrion Music Server (formerly Logitech Media Sever) to my MM.  (With alot of coding help from Google’s Gemini ai, full disclosure) .</p>
<p dir="auto">I have a working node_helper.js that retrieves the JSON data and parses it into the desired variables (text for song, artist and time remaining, URL for coverart ) verified via console.log messages.  My LyrionNowPlaying.js is accurate communicating with node_helper.js (verified via browser console messages providing correct data for artist, title etc.) but I simply cant get the module to display anything on the actual MM.  I’d be super-grateful for any insight anyone could share to help me troubleshoot, as I’m at a loss and even Gemini is giving up…</p>
<p dir="auto">Thanks.</p>
<p dir="auto">LyrionNowPlaying.js</p>
<pre><code>/* MagicMirror² Module: MMM-LyrionNowPlaying */

Module.register("MMM-LyrionNowPlaying", {

    // Default module config.
    defaults: {
        updateInterval: 1000, // Update interval in milliseconds (default: 1 second)
        retryDelay: 2500,
        lyrionServer: 'http://localhost:9000', // Lyrion server address for JSON-RPC
        playerName: 'livingroom-mm', // Default player name
        showCoverArt: true,
        coverArtSize: 150, // Size of the cover art image
        fadeSpeed: 4000,
    },

    getStyles: function () {
        return ["MMM-LyrionNowPlaying.css"];
    },

    start: function() {
        Log.info("Starting module: " + this.name);
        this.nowPlaying = {
            artist: "",
            song: "",
            timeRemaining: "",
            coverArt: "" 
        };
        this.isPlaying = false; // Track playback state
        this.updateDom(this.config.fadeSpeed); 
        this.scheduleUpdate();
    },

    getDom: function() {
        const wrapper = document.createElement("div");
        wrapper.classList.add("wrapper"); 

        if (this.isPlaying) {
            if (this.nowPlaying.coverArt &amp;&amp; this.config.showCoverArt) {
                const coverArtImg = document.createElement("img");
                coverArtImg.src = this.nowPlaying.coverArt;
                coverArtImg.width = this.config.coverArtSize;
                coverArtImg.height = this.config.coverArtSize;
                coverArtImg.classList.add("coverArt");
                wrapper.appendChild(coverArtImg);
            }

            const infoContainer = document.createElement("div");
            infoContainer.classList.add("infoContainer"); 

            if (this.nowPlaying.artist &amp;&amp; this.nowPlaying.song) {
                const songInfo = document.createElement("div");
                songInfo.classList.add("songInfo");
                songInfo.innerHTML = 
                    this.nowPlaying.artist + " - " + 
                    this.nowPlaying.song; 
                infoContainer.appendChild(songInfo);
            }

            if (this.nowPlaying.timeRemaining) {
                const timeRemaining = document.createElement("div");
                timeRemaining.classList.add("timeRemaining");
                timeRemaining.innerHTML = "Time Remaining: " + this.nowPlaying.timeRemaining;
                infoContainer.appendChild(timeRemaining);
            }

            wrapper.appendChild(infoContainer);
        } else {
            wrapper.innerHTML = "No song is currently playing."; 
        }

        return wrapper;
    },

    scheduleUpdate: function() {
        setInterval(() =&gt; {
            this.getLyrionNowPlaying();
        }, this.config.updateInterval);
    },

    getLyrionNowPlaying: function() {
        this.sendSocketNotification('GET_LYRION_NOW_PLAYING', {
            lyrionServer: this.config.lyrionServer,
            playerName: this.config.playerName
        });
    },

    socketNotificationReceived: function(notification, payload) {
        if (notification === 'LYRION_NOW_PLAYING_RESULT') {
            if (payload.error) {
                Log.error(`MMM-LyrionNowPlaying: ${payload.error}`);
            } else {
                this.nowPlaying = payload;
                console.log("Received data:", this.nowPlaying); 

                // Update playback state
                this.isPlaying = (this.nowPlaying.artist &amp;&amp; this.nowPlaying.song) ? true : false; 

                // Calculate and update timeRemaining 
                if (this.nowPlaying.duration &gt; 0 &amp;&amp; this.nowPlaying.position &gt;= 0) {
                    this.nowPlaying.timeRemaining = this.formatTime(this.nowPlaying.duration - this.nowPlaying.position); 
                } else {
                    this.nowPlaying.timeRemaining = ""; 
                }

                this.updateDom(this.config.fadeSpeed); 
            }
        }
    },

    formatTime: function(seconds) {
        const minutes = Math.floor(seconds / 60);
        const remainingSeconds = seconds % 60;
        return `${minutes}:${remainingSeconds.toString().padStart(2, '0')}`;
    }
});

</code></pre>
<p dir="auto">LyrionNowPlaying.css</p>
<pre><code>.module.MMM-LyrionNowPlaying {
    width: auto; 
    max-width: 300px; 
    background-color: rgba(255, 255, 255, 0.1); 
    border-radius: 5px; 
    padding: 10px; 
    text-align: center;
}

.coverArt {
    margin-bottom: 10px;
}

.infoContainer {
    text-align: center; 
}

.songInfo {
    font-weight: bold; 

</code></pre>
<p dir="auto">Relevant config.js (with correct IP and player name masked):</p>
<pre><code>                {
                        module: 'MMM-LyrionNowPlaying',
                        position: 'bottom_center',
                        config: {
                                lyrionServer: 'http://xx.xx.xx.xx:9000', // Use port 9000 for JSON-RPC
                                playerName: 'YYYYYYY,
                                // Other config options 
                                }
                },

</code></pre>
]]></description><link>https://forum.magicmirror.builders/topic/19455/diy-module-displays-nothing</link><generator>RSS for Node</generator><lastBuildDate>Tue, 09 Jun 2026 02:40:58 GMT</lastBuildDate><atom:link href="https://forum.magicmirror.builders/topic/19455.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 18 Feb 2025 21:38:13 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to DIY Module Displays Nothing on Wed, 19 Feb 2025 20:42:50 GMT]]></title><description><![CDATA[<p dir="auto">It was the fade!  when I switch the fade to 0, even the refresh of 1 seconds works and displays perfectly.  <a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a> you are brilliant!</p>
<p dir="auto">Thank you!</p>
]]></description><link>https://forum.magicmirror.builders/post/124188</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/124188</guid><dc:creator><![CDATA[hokie-bird]]></dc:creator><pubDate>Wed, 19 Feb 2025 20:42:50 GMT</pubDate></item><item><title><![CDATA[Reply to DIY Module Displays Nothing on Wed, 19 Feb 2025 20:17:10 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hokie-bird" aria-label="Profile: hokie-bird">@<bdi>hokie-bird</bdi></a> you are also asking for a 4 second transition on the changes w updateDom(…)</p>
<p dir="auto">so 2 seconds fade out and 2 seconds fade in</p>
<p dir="auto">this.updateDom(this.config.fadeSpeed);<br />
and you are interrupting the  fade with another updateDom</p>
]]></description><link>https://forum.magicmirror.builders/post/124186</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/124186</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Wed, 19 Feb 2025 20:17:10 GMT</pubDate></item><item><title><![CDATA[Reply to DIY Module Displays Nothing on Wed, 19 Feb 2025 20:06:33 GMT]]></title><description><![CDATA[<p dir="auto">Thank you again <a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a></p>
<p dir="auto">I implemented both of your changes (removing sendSocketNotification() in start and 5 second refresh interval) and it seems the refresh interval is what is impacting the display.  At 1 second, basically nothing, but at 5 seconds I get a 5 second display, then maybe a 2 second disappearance and then a 5 second display repeating pattern.  (Which is somewhat interesting as the browser console is reporting accurate data every 1 second, despite nothing being displayed.)  Not sure how to get a constant/non-disappearing display (when music is playing) while still getting an accurate reflection/countdown of the time remain, but I’ll experiment with that.</p>
<p dir="auto">Of course, suggestions welcome.  And thanks again.</p>
]]></description><link>https://forum.magicmirror.builders/post/124185</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/124185</guid><dc:creator><![CDATA[hokie-bird]]></dc:creator><pubDate>Wed, 19 Feb 2025 20:06:33 GMT</pubDate></item><item><title><![CDATA[Reply to DIY Module Displays Nothing on Wed, 19 Feb 2025 19:25:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hokie-bird" aria-label="Profile: hokie-bird">@<bdi>hokie-bird</bdi></a> not sure, but two things</p>
<ol>
<li>
<p dir="auto">the sendSocketNotification() in start should be removed , the browser side is not up yet.</p>
</li>
<li>
<p dir="auto">you are sending  requests for playing info 1/second,<br />
can the server handle multiple concurrently?<br />
how long  is the response time ?</p>
</li>
</ol>
<p dir="auto">i would change that to 5 seconds to test,<br />
you can change it in config.js</p>
]]></description><link>https://forum.magicmirror.builders/post/124184</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/124184</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Wed, 19 Feb 2025 19:25:06 GMT</pubDate></item><item><title><![CDATA[Reply to DIY Module Displays Nothing on Wed, 19 Feb 2025 15:17:06 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/sdetweil" aria-label="Profile: sdetweil">@<bdi>sdetweil</bdi></a> cant thank you enough for taking the time to do that, WOW!</p>
<p dir="auto">Here’s what I’ve learned.  I subbed your LyrionNowPlaying.js in for mine, and results were exactly the same:  “No song currently playing” at startup for a second or two, vanishes and never returns despite music starting/stopping.  Then I subbed your node_helper.js for mine (with your module.js file and .png) and BOOM! your data and image appeared!  Granted, it would appear for 4 seconds or so, disappear for 1-2, then re-appear but progress!  So, safe to assume its somehow something in my node_helper?  Here’s the latest, and again wildly grateful for your help.</p>
<p dir="auto">node_helper.js</p>
<pre><code>const NodeHelper = require('node_helper');
const request = require('request');

module.exports = NodeHelper.create({

    start: function() {
        console.log("Starting node_helper for: " + this.name);
        this.nowPlaying = { 
            artist: "", 
            song: "",
            timeRemaining: "",
            duration: 0, 
            position: 0,
            coverArt: "" 
        }; 
        this.sendSocketNotification('LYRION_NOW_PLAYING_RESULT', this.nowPlaying); // Send initial empty state
    },

    socketNotificationReceived: function(notification, payload) {
        if (notification === 'GET_LYRION_NOW_PLAYING') {
            this.getLyrionNowPlaying(payload);
        }
    },

    getLyrionNowPlaying: function(payload) {
        const { lyrionServer, playerName } = payload;
        const options = {
            url: `${lyrionServer}/jsonrpc.js`,
            method: 'POST',
            headers: {
                'Content-Type': 'application/json'
            },
            body: JSON.stringify({
                "id": 1,
                "method": "slim.request",
                "params": [playerName, ["status", "-", 1, "tags:artist"&rsqb;&rsqb; 
            })
        };

        request(options, (error, response, body) =&gt; {
            if (error) {
                console.error(`MMM-LyrionNowPlaying: Error connecting to Lyrion server: ${error}`);
                this.sendSocketNotification('LYRION_NOW_PLAYING_RESULT', { error: `Error connecting to Lyrion server: ${error}` });
                return;
            }

            if (response.statusCode !== 200) {
                console.error(`MMM-LyrionNowPlaying: Received unexpected status code from Lyrion server: ${response.statusCode}`);
                this.sendSocketNotification('LYRION_NOW_PLAYING_RESULT', { error: `Received unexpected status code from Lyrion server: ${response.statusCode}` });
                return;
            }

            try {
                const data = JSON.parse(body);
                console.log("Raw Data:", data); 

                if (!data.result) {
                    console.error(`MMM-LyrionNowPlaying: Invalid response from Lyrion server: Missing 'result' in response`);
                    this.sendSocketNotification('LYRION_NOW_PLAYING_RESULT', { error: `Invalid response from Lyrion server: Missing 'result' in response` });
                    return;
                }

                if (!data.result.mode || data.result.mode !== 'play') { 
                    this.nowPlaying = { 
                        artist: "", 
                        song: "",
                        timeRemaining: "",
                        duration: 0, 
                        position: 0,
                        coverArt: "" 
                    }; 
                    this.sendSocketNotification('LYRION_NOW_PLAYING_RESULT', this.nowPlaying); // Send "no song" notification immediately
                    return; 
                }

                // Handle cases where playlist_loop might be missing or empty
                let artist = "Unknown Artist";
                let song = "Unknown Song";

                if (data.result.playlist_loop &amp;&amp; data.result.playlist_loop[0]) {
                    artist = data.result.playlist_loop[0].artist || "Unknown Artist";
                    song = data.result.playlist_loop[0].title || "Unknown Song"; 
                }

                this.nowPlaying = {
                    artist: artist,
                    song: song,
                    duration: data.result.duration || 0, 
                    position: data.result.time || 0,
                    coverArt: `${lyrionServer}/music/current/cover.jpg?player=${playerName}` 
                }; 

                this.nowPlaying.timeRemaining = this.formatTime(this.nowPlaying.duration - this.nowPlaying.position);

                this.sendSocketNotification('LYRION_NOW_PLAYING_RESULT', this.nowPlaying); 

            } catch (err) {
                console.error(`MMM-LyrionNowPlaying: Error parsing Lyrion API response: ${err}`);
                this.sendSocketNotification('LYRION_NOW_PLAYING_RESULT', { error: `Error parsing Lyrion API response: ${err}` });
            }
        });
    },

    formatTime: function(seconds) {
        const minutes = Math.floor(seconds / 60);
        const remainingSeconds = seconds % 60;
        return `${minutes}:${remainingSeconds.toString().padStart(2, '0')}`;
    }
});

</code></pre>
]]></description><link>https://forum.magicmirror.builders/post/124173</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/124173</guid><dc:creator><![CDATA[hokie-bird]]></dc:creator><pubDate>Wed, 19 Feb 2025 15:17:06 GMT</pubDate></item><item><title><![CDATA[Reply to DIY Module Displays Nothing on Wed, 19 Feb 2025 04:31:03 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hokie-bird" aria-label="Profile: hokie-bird">@<bdi>hokie-bird</bdi></a></p>
<p dir="auto">I built it and fixed  minor things…<br />
created a dummy node_helper and a dummy album art png.</p>
<p dir="auto">so save yours out of the way,(rename the folder)<br />
cd ~/MagicMirror/modules<br />
git clone  <a href="https://github.com/sdetweil/MMM-LyrionNowPlaying" target="_blank" rel="noopener noreferrer nofollow ugc">https://github.com/sdetweil/MMM-LyrionNowPlaying</a></p>
<p dir="auto">test<br />
copy your node helper over mine</p>
<p dir="auto">be careful on your update frequency asking the node_helper all the time…</p>
<p dir="auto">once per second is probably too fast…<br />
i made mine ignore socketNotifications() til a response was sent (after 5 second delay) from the 1st time.<br />
the duration is  just number that changes…, duration  just a fixed number</p>
]]></description><link>https://forum.magicmirror.builders/post/124154</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/124154</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Wed, 19 Feb 2025 04:31:03 GMT</pubDate></item><item><title><![CDATA[Reply to DIY Module Displays Nothing on Wed, 19 Feb 2025 02:56:23 GMT]]></title><description><![CDATA[<p dir="auto">Thanks to all for the suggestions.  Ive attempted to incorporate them all, which has yeilded a small bit of progress:  now 'No song is playing" appears bottom_center at MM startup for a second or 2, then vanishes nothing displaying again regardless of whether music starts, stops, etc.  Browser console still reports data being received, and I cant figure how else to use the Developer Tools to troubleshoot.  Here’s the latest code:</p>
<p dir="auto">MMM-LyrionNowPlaying.js</p>
<pre><code>/* MagicMirror² Module: MMM-LyrionNowPlaying */

Module.register("MMM-LyrionNowPlaying", {

    // Default module config.
    defaults: {
        updateInterval: 1000,
        retryDelay: 2500,
        lyrionServer: 'http://localhost:9000',
        playerName: 'livingroom-mm',
        showCoverArt: true,
        coverArtSize: 150,
        fadeSpeed: 4000,
    },

    getStyles: function () {
        return ["MMM-LyrionNowPlaying.css"];
    },

    start: function () {
        Log.info("Starting module: " + this.name);
        this.nowPlaying = {
            artist: "",
            song: "",
            timeRemaining: "",
            coverArt: ""
        };
        this.isPlaying = false;
        this.updateTimer = null; // Initialize updateTimer

        this.updateDom(0);
        this.scheduleUpdate();
    },

    notificationReceived: function (notification, payload, sender) {
        if (notification === "ALL_MODULES_STARTED" || notification === "DOM_OBJECTS_CREATED") {
            this.sendSocketNotification('GET_LYRION_NOW_PLAYING', {
                lyrionServer: this.config.lyrionServer,
                playerName: this.config.playerName
            });
        }
    },

    getDom: function () {
        const wrapper = document.createElement("div");
        wrapper.classList.add("wrapper");

        if (this.isPlaying) {
            if (this.nowPlaying.coverArt &amp;&amp; this.config.showCoverArt) {
                const coverArtImg = document.createElement("img");
                coverArtImg.src = this.nowPlaying.coverArt;
                coverArtImg.width = this.config.coverArtSize;
                coverArtImg.height = this.config.coverArtSize;
                coverArtImg.classList.add("coverArt");
                wrapper.appendChild(coverArtImg);
            }

            const infoContainer = document.createElement("div");
            infoContainer.classList.add("infoContainer");

            if (this.nowPlaying.artist &amp;&amp; this.nowPlaying.song) {
                const songInfo = document.createElement("div");
                songInfo.classList.add("songInfo");
                songInfo.innerHTML =
                    this.nowPlaying.artist + " - " +
                    this.nowPlaying.song;
                infoContainer.appendChild(songInfo);
            }

            if (this.nowPlaying.timeRemaining) {
                const timeRemaining = document.createElement("div");
                timeRemaining.classList.add("timeRemaining");
                timeRemaining.innerHTML = "Time Remaining: " + this.nowPlaying.timeRemaining;
                infoContainer.appendChild(timeRemaining);
            }

            wrapper.appendChild(infoContainer);
        } else {
            wrapper.innerHTML = "No song is currently playing.";
        }

        console.log("Generated HTML:", wrapper.innerHTML);
        return wrapper;
    },

    scheduleUpdate: function () {
        if (this.updateTimer) {
            clearInterval(this.updateTimer);
        }

        this.updateTimer = setInterval(() =&gt; {
            this.getLyrionNowPlaying();
        }, this.config.updateInterval);
    },

    getLyrionNowPlaying: function () {
        this.sendSocketNotification('GET_LYRION_NOW_PLAYING', {
            lyrionServer: this.config.lyrionServer,
            playerName: this.config.playerName
        });
    },

    socketNotificationReceived: function (notification, payload) {
        if (notification === 'LYRION_NOW_PLAYING_RESULT') {
            if (payload.error) {
                Log.error(`MMM-LyrionNowPlaying: ${payload.error}`);
            } else {
                this.nowPlaying = payload;
                console.log("Received data:", this.nowPlaying);
                console.log("this.nowPlaying after update:", this.nowPlaying);

                // Corrected isPlaying check:
                this.isPlaying = (this.nowPlaying.artist &amp;&amp; this.nowPlaying.artist !== "" &amp;&amp; this.nowPlaying.song &amp;&amp; this.nowPlaying.song !== "") ? true : false;

                const duration = Number(this.nowPlaying.duration);
                const position = Number(this.nowPlaying.position);

                if (!isNaN(duration) &amp;&amp; !isNaN(position) &amp;&amp; duration &gt; 0 &amp;&amp; position &gt;= 0) {
                    this.nowPlaying.timeRemaining = this.formatTime(duration - position);
                } else {
                    this.nowPlaying.timeRemaining = "";
                }

                this.updateDom(this.config.fadeSpeed);
            }
        }
    },

    formatTime: function (seconds) {
        const minutes = Math.floor(seconds / 60);
        const remainingSeconds = seconds % 60;
        return `${minutes}:${remainingSeconds.toString().padStart(2, '0')}`;
    }
});

</code></pre>
<p dir="auto">Suggestions welcome and again a huge thank you to the community.</p>
]]></description><link>https://forum.magicmirror.builders/post/124153</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/124153</guid><dc:creator><![CDATA[hokie-bird]]></dc:creator><pubDate>Wed, 19 Feb 2025 02:56:23 GMT</pubDate></item><item><title><![CDATA[Reply to DIY Module Displays Nothing on Wed, 19 Feb 2025 00:44:46 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hokie-bird" aria-label="Profile: hokie-bird">@<bdi>hokie-bird</bdi></a></p>
<p dir="auto">this test<br />
this.isPlaying = (this.nowPlaying.artist &amp;&amp; this.nowPlaying.song) ? true : false;</p>
<p dir="auto">will always evaluate to true<br />
if artist and song are “”, as strings those will evaluate to true</p>
<p dir="auto">null is a non-true value, but also not a string</p>
]]></description><link>https://forum.magicmirror.builders/post/124147</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/124147</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Wed, 19 Feb 2025 00:44:46 GMT</pubDate></item><item><title><![CDATA[Reply to DIY Module Displays Nothing on Tue, 18 Feb 2025 23:14:45 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hokie-bird" aria-label="Profile: hokie-bird">@<bdi>hokie-bird</bdi></a> as chris mentioned you only need to call setInterval once.</p>
<p dir="auto">but to minimize your code change, you can change them to<br />
setTimeout</p>
<p dir="auto">in either case, when your module is hidden, you should stop the timer, and restart it when shown again</p>
<p dir="auto">suspend() and resume() functions will advise when those events happen ( MMM-pages would do those on a cycle to test against )</p>
]]></description><link>https://forum.magicmirror.builders/post/124146</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/124146</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Tue, 18 Feb 2025 23:14:45 GMT</pubDate></item><item><title><![CDATA[Reply to DIY Module Displays Nothing on Tue, 18 Feb 2025 22:48:37 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/chrisfr1976" aria-label="Profile: chrisfr1976">@<bdi>chrisfr1976</bdi></a> there are no module reloads, one time per page load</p>
]]></description><link>https://forum.magicmirror.builders/post/124145</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/124145</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Tue, 18 Feb 2025 22:48:37 GMT</pubDate></item><item><title><![CDATA[Reply to DIY Module Displays Nothing on Tue, 18 Feb 2025 22:16:47 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hokie-bird" aria-label="Profile: hokie-bird">@<bdi>hokie-bird</bdi></a></p>
<p dir="auto">Possible Issues:<br />
In start(), you call this.scheduleUpdate(), which creates an interval. However, scheduleUpdate() sets a new interval each time it is called. If start() runs multiple times (e.g., on module reloads), multiple intervals will be created.<br />
Fix: Store the interval in this.updateTimer and clear it before setting a new one:</p>
<pre><code>scheduleUpdate: function() {
    if (this.updateTimer) clearInterval(this.updateTimer);
    this.updateTimer = setInterval(() =&gt; {
        this.getLyrionNowPlaying();
    }, this.config.updateInterval);
},
</code></pre>
<p dir="auto">this.nowPlaying.duration and this.nowPlaying.position are used, but there’s no check if they are numbers. Ensure they are valid numbers before calculating.</p>
<pre><code>if (typeof this.nowPlaying.duration === "number" &amp;&amp; typeof this.nowPlaying.position === "number" &amp;&amp;
    this.nowPlaying.duration &gt; 0 &amp;&amp; this.nowPlaying.position &gt;= 0) {
    this.nowPlaying.timeRemaining = this.formatTime(this.nowPlaying.duration - this.nowPlaying.position);
} else {
    this.nowPlaying.timeRemaining = "";
}
</code></pre>
<p dir="auto">And in your css a closing } is missing   But maybe copy+paste mistake.</p>
]]></description><link>https://forum.magicmirror.builders/post/124144</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/124144</guid><dc:creator><![CDATA[chrisfr1976]]></dc:creator><pubDate>Tue, 18 Feb 2025 22:16:47 GMT</pubDate></item><item><title><![CDATA[Reply to DIY Module Displays Nothing on Tue, 18 Feb 2025 22:12:07 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hokie-bird" aria-label="Profile: hokie-bird">@<bdi>hokie-bird</bdi></a> also you cannot updateDom() in start()</p>
<p dir="auto">use the notification ALL_MODULES_STARTED or DOM_OBJECTS_CREATED<br />
per the doc.<br />
also  sendSocketNotification to node helper should wait til then too</p>
]]></description><link>https://forum.magicmirror.builders/post/124143</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/124143</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Tue, 18 Feb 2025 22:12:07 GMT</pubDate></item><item><title><![CDATA[Reply to DIY Module Displays Nothing on Tue, 18 Feb 2025 21:58:11 GMT]]></title><description><![CDATA[<p dir="auto"><a class="plugin-mentions-user plugin-mentions-a" href="/user/hokie-bird" aria-label="Profile: hokie-bird">@<bdi>hokie-bird</bdi></a>  cant tell directly, open the developers window, ctrl-shift-i. sources tab,</p>
<p dir="auto">find your module in the left navigation, select the js code appears in the right pane, click on your getDom  1st line of code line number.</p>
<p dir="auto">hit f5 or ctrl-r to refresh the page</p>
]]></description><link>https://forum.magicmirror.builders/post/124142</link><guid isPermaLink="true">https://forum.magicmirror.builders/post/124142</guid><dc:creator><![CDATA[sdetweil]]></dc:creator><pubDate>Tue, 18 Feb 2025 21:58:11 GMT</pubDate></item></channel></rss>