-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Add condition to call the toggle service for media_players #4250
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
Changes from all commits
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 |
|---|---|---|
|
|
@@ -178,13 +178,19 @@ export default class MediaPlayerEntity { | |
| } | ||
|
|
||
| togglePower() { | ||
| if (this.isOff) { | ||
| if (this.supportsTurnOn && this.supportsTurnOff) { | ||
|
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. This condition may not be necessary, we may be able to simply call 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. Honestly the Plex integration should probably not advertise as supporting either power on/off as it doesn't have the ability to do either.
Contributor
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. There are more that can't turn on. Philips js, arcam. They can support it with external wol or it blasters. |
||
| this.toggle(); | ||
| } else if (this.isOff) { | ||
| this.turnOn(); | ||
| } else { | ||
| this.turnOff(); | ||
| } | ||
| } | ||
|
|
||
| toggle() { | ||
| this.callService("toggle"); | ||
| } | ||
|
|
||
| turnOff() { | ||
| this.callService("turn_off"); | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.