Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update light.py #19

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update light.py #19

wants to merge 1 commit into from

Conversation

chpego
Copy link

@chpego chpego commented Oct 12, 2020

  • changing the variable names in the list of available effects
  • added Lounge Light HOT_LAVA, DEEP_WATER and FRESH_NATURE effects

- changing the variable names in the list of available effects
- added Lounge Light HOT_LAVA, DEEP_WATER and FRESH_NATURE effects
@Verguldebarman
Copy link

Tried a manual update of light.py. Lot's of errors unfortunattely. See below:

2020-11-21 12:48:06 ERROR (MainThread) [homeassistant.helpers.entity] Update for light.tv_ambilight fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, in async_device_update raise exc File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/philips_ambilight/light.py", line 280, in update self.getState() File "/config/custom_components/philips_ambilight/light.py", line 197, in getState effect = fullstate['menuSetting'] KeyError: 'menuSetting' 2020-11-21 12:48:08 ERROR (MainThread) [homeassistant.helpers.entity] Update for light.tv_ambilight fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, in async_device_update raise exc File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/philips_ambilight/light.py", line 280, in update self.getState() File "/config/custom_components/philips_ambilight/light.py", line 197, in getState effect = fullstate['menuSetting'] KeyError: 'menuSetting' 2020-11-21 12:48:10 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [1892763560] 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 135, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1451, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1486, in _execute_service await handler.job.target(service_call) File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service await self.hass.helpers.service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 499, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 664, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 536, in _handle_entity_call await result File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 699, in async_turn_off await self.hass.async_add_executor_job(ft.partial(self.turn_off, **kwargs)) File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/philips_ambilight/light.py", line 186, in turn_off OLD_STATE = [self._hs[0], self._hs[1], self._brightness, self._effect] TypeError: 'NoneType' object is not subscriptable 2020-11-21 12:48:12 ERROR (MainThread) [homeassistant.helpers.entity] Update for light.tv_ambilight fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, in async_device_update raise exc File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/philips_ambilight/light.py", line 280, in update self.getState() File "/config/custom_components/philips_ambilight/light.py", line 197, in getState effect = fullstate['menuSetting'] KeyError: 'menuSetting' 2020-11-21 12:48:16 ERROR (MainThread) [homeassistant.helpers.entity] Update for light.tv_ambilight fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, in async_device_update raise exc File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/philips_ambilight/light.py", line 280, in update self.getState() File "/config/custom_components/philips_ambilight/light.py", line 197, in getState effect = fullstate['menuSetting'] KeyError: 'menuSetting' 2020-11-21 12:48:21 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/google_assistant/report_state.py", line 49, in async_entity_state_listener if entity_data == old_entity.query_serialize(): File "/usr/src/homeassistant/homeassistant/components/google_assistant/helpers.py", line 489, in query_serialize deep_update(attrs, trt.query_attributes()) File "/usr/src/homeassistant/homeassistant/components/google_assistant/trait.py", line 404, in query_attributes "value": brightness / 255, TypeError: unsupported operand type(s) for /: 'NoneType' and 'int' 2020-11-21 12:48:24 ERROR (MainThread) [homeassistant.helpers.entity] Update for light.tv_ambilight fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, in async_device_update raise exc File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/philips_ambilight/light.py", line 280, in update self.getState() File "/config/custom_components/philips_ambilight/light.py", line 197, in getState effect = fullstate['menuSetting'] KeyError: 'menuSetting' 2020-11-21 12:48:26 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [1892763560] 'NoneType' object is not subscriptable Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/components/websocket_api/commands.py", line 135, in handle_call_service await hass.services.async_call( File "/usr/src/homeassistant/homeassistant/core.py", line 1451, in async_call task.result() File "/usr/src/homeassistant/homeassistant/core.py", line 1486, in _execute_service await handler.job.target(service_call) File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 204, in handle_service await self.hass.helpers.service.entity_service_call( File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 499, in entity_service_call future.result() # pop exception if have File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 664, in async_request_call await coro File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 536, in _handle_entity_call await result File "/usr/src/homeassistant/homeassistant/components/light/__init__.py", line 230, in async_handle_light_on_service await light.async_turn_on(**params) File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 690, in async_turn_on await self.hass.async_add_executor_job(ft.partial(self.turn_on, **kwargs)) File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/philips_ambilight/light.py", line 168, in turn_on "colorSettings":{"color":{"hue":int(self._hs[0]*(255/360)),"saturation":int(self._hs[1]*(255/100)), TypeError: 'NoneType' object is not subscriptable 2020-11-21 12:48:32 ERROR (MainThread) [homeassistant.helpers.entity] Update for light.tv_ambilight fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 278, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 474, in async_device_update raise exc File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/philips_ambilight/light.py", line 280, in update self.getState() File "/config/custom_components/philips_ambilight/light.py", line 197, in getState effect = fullstate['menuSetting'] KeyError: 'menuSetting' 2020-11-21 12:48:33 WARNING (MainThread) [homeassistant.components.device_tracker] Updating device list from legacy took longer than the scheduled scan interval 0:00:12

Copy link

@LineC0der LineC0der left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It actually works! Manual color-change is working again after the new Philips update.
Thanks a lot!

But like @iTacco says, it's still buggy and not working perfect.

@iTacco
Copy link

iTacco commented Nov 27, 2020

Thank you very much.
It fixed the bug. I can change the manual colors again.

But its still not perfect. Some displaying bugs inside HomeAssistant.
I am changing the mode to "Party" for example. The TV changes the mode aswell. But Homeassistant displaying the mode I set manually on the TV before.

An other bug, the mode "Warm White" not working at all.

EFFECT_LL_HOT_LAVA = "Hot Lava"
EFFECT_LL_DEEP_WATER = "Deep Water"
EFFECT_LL_FRESH_NATURE = "Fresh Nature"

These three modes changing the color on the TV but I am getting an error popup inside HomeAssistant.
Error message: "Error when calling the service light/turn_on. name 'false' is not defined"

@chpego
Copy link
Author

chpego commented Nov 30, 2020

Thank's @iTacco @LineC0der ;)
I'm not a Python developer but i think we can find why there is some trouble in the code 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants