sermayoral / ha-samsungtv-encrypted

Samsung TV Encrypted Models (H & J Series) custom component for Home Assistant
Apache License 2.0
39 stars 24 forks source link

'NoneType' object has no attribute 'startswith' in discoverSSDP #25

Closed bartoszpierzchlewicz closed 4 years ago

bartoszpierzchlewicz commented 4 years ago

Hi, when TV (H6400 serie) is turned on I receive exception every 10 seconds. There is no problem with turning on/off TV (HDMI) , adjusting volume and mute. Home Assistant 0.108.9 python_version | 3.7.7

ERROR (MainThread) [homeassistant.helpers.entity] Update for media_player.samsung_tv_remote fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 279, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 476, in async_device_update await self.hass.async_add_executor_job(self.update) File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/samsungtv_encrypted/media_player.py", line 189, in update self._upnp_ports, self._upnp_paths = self.discoverSSDP(timeout=2) File "/config/custom_components/samsungtv_encrypted/media_player.py", line 457, in discoverSSDP if entry.location.startswith('http://{}'.format(self._config['host'])): AttributeError: 'NoneType' object has no attribute 'startswith'

bartoszpierzchlewicz commented 4 years ago

I can confirm, commit from #26 cause that ERROR not occur anymore. Thanks.

sermayoral commented 4 years ago

Thanks both :-)