Hello to all people hosting homeydash on your own server… and @DaneedeKruyff as idea for HomeyDash…
There was a discussion in the german part about the timeline and how to clear ist with one click.
@mapulu gave the hint about the web API method: Timeline Flow - #7 by mapulu
So I added a delete buttoin to HomeyDash:
-
use the existing “delete.png” or add your preferred icon to the folder app/img/ like these icons:
-
Add this code to homeydash.app.js, function renderInfoPanel( ) after lines
case “t”:
$infopanel.innerHTML = ‘’;var $infoPanelNotificationsIcon = document.createElement('div'); $infoPanelNotificationsIcon.id = "infopanel-notifications-icon" $infoPanelNotificationsIcon.classList.add('infopanel-notifications-icon'); $infopanel.appendChild($infoPanelNotificationsIcon); $infoPanelNotificationsIcon.style.backgroundImage = 'url(img/delete.png)'; $infoPanelNotificationsIcon.style.backgroundSize = 'cover'; $infoPanelNotificationsIcon.style.backgroundPosition = 'center'; $infoPanelNotificationsIcon.addEventListener('click', function() { homey.notifications.deleteNotifications( ); });
-
Add the style to web.css:
.infopanel-notifications-icon { position: absolute; top: 2vmin; left: 2vmin; width: 7vmin; height: 7vmin; }