Fix log spam when wife's work schedule is not in the calendar
This commit is contained in:
@ -3,16 +3,34 @@ let today = msg.today
|
||||
let number = {}
|
||||
let work_tomorrow = {}
|
||||
|
||||
if (tomorrow > 0) {
|
||||
// Check if calendar data exists
|
||||
if (!msg.payload || msg.payload.length === 0) {
|
||||
msg.payload = [{
|
||||
date: "No Data",
|
||||
eventStart: "No Data",
|
||||
eventEnd: "No Data",
|
||||
summary: "No Data",
|
||||
location: "No Data",
|
||||
isRecurring: "No Data",
|
||||
allDay: "No Data",
|
||||
calendarName: "No Data",
|
||||
countdown: "No Data",
|
||||
uid: { date: "No Data" }
|
||||
}]
|
||||
work_tomorrow = "false"
|
||||
number = 0
|
||||
} else {
|
||||
if (tomorrow > 0) {
|
||||
work_tomorrow = "true"
|
||||
if (today == 0) {
|
||||
number = 0
|
||||
} else {
|
||||
number = 1
|
||||
}
|
||||
} else {
|
||||
} else {
|
||||
work_tomorrow = "false"
|
||||
number = 0
|
||||
}
|
||||
}
|
||||
|
||||
msg.work_tomorrow = work_tomorrow
|
||||
|
Reference in New Issue
Block a user