diff --git a/braviapsk/sony_bravia_psk.py b/braviapsk/sony_bravia_psk.py index 8158170..d85db4d 100644 --- a/braviapsk/sony_bravia_psk.py +++ b/braviapsk/sony_bravia_psk.py @@ -85,7 +85,7 @@ def connect(self, pin, clientid, nickname): except requests.exceptions.HTTPError as exception_instance: _LOGGER.error("[W] HTTPError: " + str(exception_instance)) return False - + except requests.exceptions.Timeout as exception_instance: _LOGGER.error("[W] Timeout occurred: " + str(exception_instance)) return False @@ -126,6 +126,8 @@ def _wakeonlan(self): def send_req_ircc(self, params, log_errors=True): """Send an IRCC command via HTTP to Sony Bravia.""" + if params is None: + return False headers = {'X-Auth-PSK': self._psk, 'SOAPACTION': '"urn:schemas-sony-com:service:IRCC:1#X_SendIRCC"'} data = ("