mirror of
https://github.com/home-assistant/core.git
synced 2025-07-19 11:17:21 +00:00
parent
5513ffc33c
commit
0f26ebe954
@ -121,9 +121,14 @@ class SamsungTVDevice(MediaPlayerDevice):
|
|||||||
self._config['method'] = 'legacy'
|
self._config['method'] = 'legacy'
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
"""Retrieve the latest data."""
|
"""Update state of device."""
|
||||||
# Send an empty key to see if we are still connected
|
try:
|
||||||
self.send_key('KEY')
|
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
|
||||||
|
sock.settimeout(self._config[CONF_TIMEOUT])
|
||||||
|
sock.connect((self._config['host'], self._config['port']))
|
||||||
|
self._state = STATE_ON
|
||||||
|
except socket.error:
|
||||||
|
self._state = STATE_OFF
|
||||||
|
|
||||||
def get_remote(self):
|
def get_remote(self):
|
||||||
"""Create or return a remote control instance."""
|
"""Create or return a remote control instance."""
|
||||||
|
Loading…
x
Reference in New Issue
Block a user