Media player BraviaTv : Try to connect only if tv is not in off state. (#4140)

When HA is restart with the TV in off state there was error log every 10s until the TV is set ON.
This commit is contained in:
Nicolas Graziano authored and Paulus Schoutsen committed 2016-11-02 19:51:53 -07:00
1 parent df68de8032
commit 1e28851280
1 file changed
+2 -1
@@ -219,7 +219,8 @@ class BraviaTVDevice(MediaPlayerDevice):
def update(self):
"""Update TV info."""
if not self._braviarc.is_connected():
self._braviarc.connect(self._pin, CLIENTID_PREFIX, NICKNAME)
if self._braviarc.get_power_status() != 'off':
self._braviarc.connect(self._pin, CLIENTID_PREFIX, NICKNAME)
if not self._braviarc.is_connected():
return