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

Retry power command on error #330

Merged
merged 5 commits into from Apr 5, 2023
Merged

Conversation

matejdro
Copy link
Contributor

On Nvidia Shield, power service can sometimes reply with "Failed to write while dumping service". When this happens, power state will be output as None, even when device is turned on. This can cause Home Assistant to randomly switch playing -> standby -> playing momentarily.

As a workaround, this PR attempts to detect the error and re-send the command when it happens.

@matejdro
Copy link
Contributor Author

Any tips on where to add extra tests to improve code coverage?

@JeffLIrion
Copy link
Owner

I'd put it here:

async def test_screen_on_awake_wake_lock_size(self):

Also, please make the same changes in the non-async code.

@JeffLIrion JeffLIrion merged commit 5dcac19 into JeffLIrion:master Apr 5, 2023
@matejdro matejdro deleted the power_retry branch September 27, 2023 07:15
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.

None yet

2 participants