Further patch to fix of #22890 (#23627)

This commit is contained in:
Penny Wood 2019-05-03 05:05:16 +08:00 committed by Paulus Schoutsen
parent 592e99947d
commit 3338f5c9b4

View File

@ -200,7 +200,8 @@ class WebSocketHandler:
else:
self._logger.warning("Disconnected: %s", disconnect_warn)
self.hass.data[DATA_CONNECTIONS] -= 1
if connection is not None:
self.hass.data[DATA_CONNECTIONS] -= 1
self.hass.helpers.dispatcher.async_dispatcher_send(
SIGNAL_WEBSOCKET_DISCONNECTED)