From 58e2781412a792cb91c32f02b7457617b740080d Mon Sep 17 00:00:00 2001 From: PhracturedBlue Date: Tue, 8 Aug 2017 20:58:37 -0700 Subject: [PATCH] Add Initial Mailbox panel and sensor (#319) * Add Initial Mailbox panel * Use sha rather than index to lookup mp3 file * Popups for audio and delete-confirmation. Don't load all MP3s on page load * Show duration of message * Reload messages on change * eslint fixes * Wrap transcription text. Use 2nd-row per entry for transcription. Table consumes 100% of window height * Update to support mailbox component * Use mailbox component state instead of sensor state. Fix a bug in delete * Display mailbox entity * Use events to trigger mailbox updates * Support multiple mailbox platforms * Use REST API for mailbox deletion * Fix linting issues * Make dialogs reactive * Replace vaadin-grid with paper-items * 1st attempt at truncating lines to two columns * Apply requested changes from review * Clean up + Lint --- panels/mailbox/ha-panel-mailbox.html | 260 +++++++++++++++++++++++++++ src/components/ha-cards.html | 1 + src/util/hass-util.html | 3 + 3 files changed, 264 insertions(+) create mode 100644 panels/mailbox/ha-panel-mailbox.html diff --git a/panels/mailbox/ha-panel-mailbox.html b/panels/mailbox/ha-panel-mailbox.html new file mode 100644 index 0000000000..f0f97aa34d --- /dev/null +++ b/panels/mailbox/ha-panel-mailbox.html @@ -0,0 +1,260 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/components/ha-cards.html b/src/components/ha-cards.html index 232165258f..b0a988fc92 100644 --- a/src/components/ha-cards.html +++ b/src/components/ha-cards.html @@ -106,6 +106,7 @@ alarm_control_panel: 3, sensor: 5, binary_sensor: 6, + mailbox: 7, }; function getPriority(domain) { diff --git a/src/util/hass-util.html b/src/util/hass-util.html index f9fe871589..07c9385116 100644 --- a/src/util/hass-util.html +++ b/src/util/hass-util.html @@ -302,6 +302,9 @@ window.hassUtil.domainIcon = function (domain, state) { case 'lock': return state && state === 'unlocked' ? 'mdi:lock-open' : 'mdi:lock'; + case 'mailbox': + return 'mdi:mailbox'; + case 'media_player': return state && state !== 'off' && state !== 'idle' ? 'mdi:cast-connected' : 'mdi:cast';