Please help me to get torn using MMM-ProfileSwitcher and MMM-pages modules
I have multiple calendars and I want to display them separately on my page. To do this, I want to get the current page number from MMM-pages and use it as ‘classes:’ in the ProfileSwitcher.
Here is what my config file looks like.
let config = {
address: "0.0.0.0", // Address to listen on, can be:
port: 8080,
basePath: "/",
ipWhitelist: ["127.0.0.1", "::ffff:127.0.0.1", "::1", "192.168.1.0/24"],
useHttps: false,
httpsPrivateKey: "",
httpsCertificate: "",
logLevel: ["INFO", "LOG", "WARN", "ERROR"],
timeFormat: 24,
units: "metric",
modules: [
//------------------------MMM-WatchDog----------------------------------------
{
module: 'MMM-WatchDog',
config: {
interval: 10,
timeout: 15,
// See 'Configuration options' for more information.
}
},
//---------------------------MMM-pages--------------------------------------
{
module: 'MMM-pages',
config: {
modules:
[["alert", "clock", "updatenotification", "calendar"],
["calendar"]],
rotationTime: 15000,
delayTime: 15000,
// !!! Action: [
//!!!! sendNotification("CURRENT_PROFILE", "1"),
//!!!! notification:'CURRENT_PROFILE', payload: this.NEW_PAGE,
// ]
},
},
//-------------------MMM-ProfileSwitcher ----------------------------
{
module: 'MMM-ProfileSwitcher',
config: {
// See 'Configuration options' for more information.
},
},
//-------------------MMM-page-indicator Page0 -------------------------
{
module: 'MMM-page-indicator',
classes: 'default everyone',
position: 'bottom_bar',
config: {
pages: 2,
//!!!! notification:'CURRENT_PROFILE', payload: NEW_PAGE,
//!!!!! Action: [
//!!!!! {notification:'CURRENT_PROFILE',payload: this.NEW_PAGE},
//!!!!! ],
},
},
//------------
{
module: "alert",
// classes: 'default everyone',
config: {
position: "center",
display_time: 4500,
},
{
module: "clock",
classes: 'default everyone',
position: "top_left"
},
//------------------calendar Page1 ---------
{
module: "calendar",
classes: 1,
header: "Alex",
position: "top_right",
config: {
displaySymbol: true,
maximumEntries: 12,
maximumNumberOfDays: 4,
coloredSymbolOnly: true,
calendars: [
{
name: "Alex",
displaySymbol: true,
symbol: 'user-secret',
url: "-------",
// maximumNumberOfDays: 1,
fade: false,
showEnd: true,
auth: {
user: '-----',
pass: '-------',
method: 'basic',
}
},
{
module: "calendar",
classes: '2',
header: "Den",
position: "top_right",
config: {
displaySymbol: true,
maximumEntries: 12,
maximumNumberOfDays: 4,
coloredSymbolOnly: true,
calendars: [
{
name: "Den",
symbol: 'user-astronaut',
url: "--------",
// maximumNumberOfDays: 1,
fade: false,
showEnd: true,
auth: {
user: '----------',
pass: '---------',
method: 'basic',
}
},
],
},
},
]
But I don’t know how should I write this.sendNotification(‘CURRENT_PROFILE’, ‘DESIRED_PROFILE_NAME_HERE’);
Please help me figure it out. If possible, an example config file. And then I’ll figure it out myself.
I will be very grateful for any help.
Thanks in advance!