Skip to content
This repository has been archived by the owner on Sep 25, 2021. It is now read-only.

Commit

Permalink
blacklist fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
atomic7777 committed Jun 19, 2019
1 parent 03370f1 commit d0386b5
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 9 deletions.
17 changes: 12 additions & 5 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class AtomicCalendar extends LitElement {
}
});
this.firstrun=false
console.log("atomic_calendar v0.8.1b loaded")
console.log("atomic_calendar v0.8.2 loaded")
}


Expand Down Expand Up @@ -680,10 +680,17 @@ class AtomicCalendar extends LitElement {
try {
return await (Promise.all(calendarUrlList.map(url =>
this.hass.callApi('get', url[0]))).then((result) => {
let ev = [].concat.apply([], (result.map((singleCalEvents, i) => {
return singleCalEvents.map(evt => new EventClass(evt, this.config.entities[i]))
})))

let singleEvents = []
result.map((calendar, i) => {
calendar.map((singleEvent) => {
let blacklist = typeof this.config.entities[i]["blacklist"] != 'undefined' ? this.config.entities[i]["blacklist"] : ''
if(blacklist=='' || !this.checkFilter(singleEvent.summary, blacklist)){
singleEvents.push(new EventClass(singleEvent, this.config.entities[i] ))
}
})
})
let ev = [].concat.apply([], singleEvents )

// grouping events by days, returns object with days and events
const groupsOfEvents = ev.reduce(function (r, a) {
r[a.daysToSort] = r[a.daysToSort] || []
Expand Down
2 changes: 1 addition & 1 deletion atomic_calendar.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/atomic_calendar.js

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions rollup-dev.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import commonjs from 'rollup-plugin-commonjs';
export default {
input: 'app.js',
output: {
file: 'atomic-calendar.js',
file: 'atomic_calendar.js',
format: 'iife'
},
watch: {
Expand All @@ -15,4 +15,4 @@ export default {
resolve(),
commonjs({ fast: true }),
]
};
};

0 comments on commit d0386b5

Please sign in to comment.