diff --git a/plotly/plotly/plotly.py b/plotly/plotly/plotly.py index a1069f8c506..a0243cbe9ec 100644 --- a/plotly/plotly/plotly.py +++ b/plotly/plotly/plotly.py @@ -454,7 +454,6 @@ def __init__(self, stream_id): """ self.stream_id = stream_id - self.connected = False self._stream = None def get_streaming_specs(self): @@ -500,6 +499,13 @@ def heartbeat(self, reconnect_on=(200, '', 408)): "cannot write to a closed connection. " "Call `open()` on the stream to open the stream." ) + + @property + def connected(self): + if self._stream is None: + return False + + return self._stream._isconnected() def open(self): """