Allow closed websocket connections to be garbage collected

This commit is contained in:
2022-07-24 20:26:49 +00:00
parent 1076bb2c9c
commit d58a29f4f9
2 changed files with 17 additions and 5 deletions

View File

@@ -133,9 +133,13 @@ class BrowserModBrowser:
def connection(self):
return self._connections
@connection.setter
def connection(self, con):
self._connections.append(con)
def open_connection(self, connection, cid):
self._connections.append((connection, cid))
def close_connection(self, connection):
self._connections = list(
filter(lambda v: v[0] != connection, self._connections)
)
def getBrowser(hass, browserID, *, create=True):