play indoor chime on ring

This commit is contained in:
2020-10-28 20:21:26 -07:00
parent 941038eece
commit be65559f87
2 changed files with 14 additions and 2 deletions

View File

@@ -13,6 +13,8 @@
<section id="log">
<h1>Incoming Events</h1>
</section>
<audio id="chime" src="indoor.mp3"></audio>
<template id="connected">
<span class="connected">Connected</span>
</template>
@@ -60,6 +62,10 @@
});
sse.addEventListener('ring', msg => {
let chime = document.getElementById('chime');
if (chime.paused) {
chime.play();
}
const template = get_template('ring');
$('#log').append(template);
});