nstrelow / ha_philips_android_tv

Home Assistant custom component for the newer (2016+) Philips Android TVs
109 stars 28 forks source link

Wake from sleep with favourite_channels_only: true doesn't work but wake from standby does #19

Closed andybjackson closed 5 years ago

andybjackson commented 5 years ago

On my 55PUS7303/12, if I add favorite_channels_only: true, then the TV will not switch on from sleep mode, whereas it will from standby mode.

Guessing it takes some time for the TV to populate this info and we ask a little too early.

Error info: 2019-06-18 13:21:21 ERROR (MainThread) [homeassistant.helpers.entity] Update for media_player.philips_55pus7703_12 fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 220, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 377, 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 "/usr/src/homeassistant/homeassistant/util/__init__.py", line 224, in wrapper result = method(*args, **kwargs) File "/config/custom_components/philips_android_tv/media_player.py", line 243, in update self._tv.update() File "/config/custom_components/philips_android_tv/media_player.py", line 342, in update self.get_favorite_channels() File "/config/custom_components/philips_android_tv/media_player.py", line 416, in get_favorite_channels _LOGGER.warn("Favorites not supported for this TV", path) NameError: name 'path' is not defined

nstrelow commented 5 years ago

Dammit, looks like I made a mistake.

NameError: name 'path' is not defined likely kills the component and I do not know why.

nstrelow commented 5 years ago

Is fixed, please update

andybjackson commented 5 years ago

Have installed the updated version. Waiting for TV to drop from Standby into Sleep mode to be able to test. Thank you for such quick turnaround.

nstrelow commented 5 years ago

Let me know how it goes. Previously, just using favorite_channels, would crash the component. Therefore the component would not work at all (I guess). Just a silly mistake, happens sometimes.

andybjackson commented 5 years ago

Now working. Thanks again. https://github.com/nstrelow/ha_philips_2016/commit/a17aa7f0fecfa28f952121f262c7d9638a182ad2