-
-
Notifications
You must be signed in to change notification settings - Fork 37.9k
Fix pjlink issue #20510
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
Fix pjlink issue #20510
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -94,14 +94,19 @@ def projector(self): | |
| def update(self): | ||
| """Get the latest state from the device.""" | ||
| with self.projector() as projector: | ||
| pwstate = projector.get_power() | ||
| if pwstate == 'off': | ||
| try: | ||
| pwstate = projector.get_power() | ||
| if pwstate == 'on' or pwstate == 'warm-up': | ||
| self._pwstate = STATE_ON | ||
| else: | ||
| self._pwstate = STATE_OFF | ||
| self._muted = projector.get_mute()[1] | ||
| self._current_source = \ | ||
| format_input_source(*projector.get_input()) | ||
| except: | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Make sure to only catch exceptions we expect.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I could make the changes you mentioned, but I'm new to Github and don't know the processes yet. Do I have to open a new pull request or is it possible to modify the existing pull request?
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just commit and push to the same branch and this PR will be updated. |
||
| self._pwstate = STATE_OFF | ||
| else: | ||
| self._pwstate = STATE_ON | ||
| self._muted = projector.get_mute()[1] | ||
| self._current_source = \ | ||
| format_input_source(*projector.get_input()) | ||
| self._muted = False | ||
| self._current_source = None | ||
|
|
||
| @property | ||
| def name(self): | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do not use bare except'