mirror of
https://github.com/home-assistant/core.git
synced 2025-04-26 10:17:51 +00:00
Frontend: stream fires ping on connect
This is needed for Safari/Firefox to call onOpen
This commit is contained in:
parent
ff4c3f791c
commit
89f59a758d
@ -126,13 +126,13 @@ def _handle_get_api_stream(handler, path_match, data):
|
|||||||
hass.bus.listen(MATCH_ALL, forward_events)
|
hass.bus.listen(MATCH_ALL, forward_events)
|
||||||
|
|
||||||
while True:
|
while True:
|
||||||
|
write_message(STREAM_PING_PAYLOAD)
|
||||||
|
|
||||||
block.wait(STREAM_PING_INTERVAL)
|
block.wait(STREAM_PING_INTERVAL)
|
||||||
|
|
||||||
if block.is_set():
|
if block.is_set():
|
||||||
break
|
break
|
||||||
|
|
||||||
write_message(STREAM_PING_PAYLOAD)
|
|
||||||
|
|
||||||
if not gracefully_closed:
|
if not gracefully_closed:
|
||||||
_LOGGER.info("Found broken event stream to %s, cleaning up",
|
_LOGGER.info("Found broken event stream to %s, cleaning up",
|
||||||
handler.client_address[0])
|
handler.client_address[0])
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
""" DO NOT MODIFY. Auto-generated by build_frontend script """
|
""" DO NOT MODIFY. Auto-generated by build_frontend script """
|
||||||
VERSION = "9d3e518a6c0516a3543fe6b364e4307b"
|
VERSION = "b9bb73c7d937ff2219001668ea739134"
|
||||||
|
File diff suppressed because one or more lines are too long
@ -67,8 +67,23 @@
|
|||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
Polymer({
|
var storeListenerMixIn = window.hass.storeListenerMixIn;
|
||||||
|
|
||||||
|
Polymer(Polymer.mixin({
|
||||||
action: "display",
|
action: "display",
|
||||||
|
isStreaming: false,
|
||||||
|
|
||||||
|
attached: function() {
|
||||||
|
this.listenToStores(true);
|
||||||
|
},
|
||||||
|
|
||||||
|
detached: function() {
|
||||||
|
this.stopListeningToStores();
|
||||||
|
},
|
||||||
|
|
||||||
|
streamStoreChanged: function(streamStore) {
|
||||||
|
this.isStreaming = streamStore.isStreaming();
|
||||||
|
},
|
||||||
|
|
||||||
submitClicked: function() {
|
submitClicked: function() {
|
||||||
this.action = "configuring";
|
this.action = "configuring";
|
||||||
@ -80,13 +95,16 @@
|
|||||||
|
|
||||||
function() {
|
function() {
|
||||||
this.action = 'display';
|
this.action = 'display';
|
||||||
window.hass.syncActions.sync();
|
|
||||||
|
if (!this.isStreaming) {
|
||||||
|
window.hass.syncActions.start();
|
||||||
|
}
|
||||||
}.bind(this),
|
}.bind(this),
|
||||||
|
|
||||||
function() {
|
function() {
|
||||||
this.action = 'display';
|
this.action = 'display';
|
||||||
}.bind(this));
|
}.bind(this));
|
||||||
}
|
},
|
||||||
});
|
}, storeListenerMixIn));
|
||||||
</script>
|
</script>
|
||||||
</polymer-element>
|
</polymer-element>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user