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

Catch exceptions for all commands sent light.zha.Light. #16752

Merged
merged 1 commit into from
Sep 20, 2018

Conversation

Adminiuga
Copy link
Contributor

Description:

Catch exceptions for all operations which may fail because of device
reachibility
More verbose debug logging on operations

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass

@walthowd
Copy link
Contributor

Thanks @Adminiuga -- I actually just submitted a pull request for the same thing, but closed it now -- this looks great!

Catch exceptions for all operations which may fail because of device
reachibility
More verbose debug logging on operations
@balloob balloob merged commit 3ea8c25 into home-assistant:dev Sep 20, 2018
@ghost ghost removed the in progress label Sep 20, 2018
@Adminiuga Adminiuga deleted the zha-light-ex branch September 21, 2018 12:54
@balloob balloob mentioned this pull request Sep 28, 2018
@walthowd
Copy link
Contributor

walthowd commented Oct 1, 2018

@Adminiuga Been testing this in 0.79.2 and so far it seems that it's working well -- If you do turn on a light that is physically switched off you will get "Couldn't change brightness level" message for the bellows delivery error, but I assume that is based on the internals of how the turn_on service calls the light with a set brightness. . . .

@Adminiuga
Copy link
Contributor Author

but I assume that is based on the internals of how the turn_on service calls the light with a set brightness

Yes, the light.zha.Light.async_turn_on() actually issues move_to_level_with_on_off Zigbee command which turns light on/off depending on the brightness level. So if the light is physically off, then move_to_level_with_on_off is going to throw DeliveryError so you respectively the error states it couldn't change the brightness level.

@home-assistant home-assistant locked and limited conversation to collaborators Feb 5, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants