@MMRIZE
Here is my config
{
module: "alert",
},
/*
{
module: "updatenotification",
position: "top_bar"
},*/
{
module: "clock",
position: "top_left"
},
{
module: "MMM-ModuleMonkeyPatch",
config: {
patches: [
{
module: "calendar",
method: "socketNotificationReceived",
patch: async function (original, args) {
const [ notification, payload ] = args
if (notification === "CALENDAR_EVENTS") {
const calendarName = this.config.calendars.find((cal) => cal.url === payload?.url)?.name
const r = await fetch('http://10.5.11.1:8080/modules/getip')
const ip = JSON.parse(await r.text())?.[ 'address' ] ?? null
console.log(ip)
if (!this.config.clientMap?.[ ip ]?.includes(calendarName)) {
return original(notification, { ...payload, events: [] })
}
}
return original(notification, payload)
}
}
]
}
},
{
module: "getip",
},
{
module: "calendar",
header: "Home Cal",
position: "top_left",
config: {
clientMap: {
"10.5.11.5": [ "cal1" ],
"10.5.11.6": ["cal2"]
},
calendars: [
{
fetchInterval: 10 * 60 * 1000,
symbol: "calendar-check",
url: "https://homecals/xEzboFt7Kr3Yfiys?export",
name: "cal1",
}
]
}
}
This is showing both 10.5.11.5 and 10.5.11.6 the same calendar. Though 10.5.11.6 should not have any calendar since it is not defined. Even I tried without an entry of 10.5.11.6 in calendar map but it still showing the calendar. What am I doing wrong. Please advice