mirror of
https://github.com/home-assistant/core.git
synced 2025-07-18 18:57:06 +00:00
parent
5513ffc33c
commit
0f26ebe954
@ -121,9 +121,14 @@ class SamsungTVDevice(MediaPlayerDevice):
|
||||
self._config['method'] = 'legacy'
|
||||
|
||||
def update(self):
|
||||
"""Retrieve the latest data."""
|
||||
# Send an empty key to see if we are still connected
|
||||
self.send_key('KEY')
|
||||
"""Update state of device."""
|
||||
try:
|
||||
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):
|
||||
"""Create or return a remote control instance."""
|
||||
|
Loading…
x
Reference in New Issue
Block a user