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

[lgwebos] Ignore power off command when the TV is already off #7300

Merged
merged 2 commits into from
Apr 5, 2020

Conversation

lolodomo
Copy link
Contributor

@lolodomo lolodomo commented Apr 5, 2020

Signed-off-by: Laurent Garnier <lg.hc@free/fr>

Signed-off-by: Laurent Garnier <lg.hc@free/fr>
@lolodomo lolodomo requested a review from sprehn as a code owner April 5, 2020 11:44
@TravisBuddy
Copy link

Travis tests were successful

Hey @lolodomo,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

Comment on lines 53 to 56
} else if (!powerOn && OnOffType.OFF == command) {
logger.debug("Received OFF - Ignored as the TV is already off.");
} else if (powerOn && OnOffType.OFF == command) {
handler.getSocket().powerOff(getDefaultResponseListener());
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
} else if (!powerOn && OnOffType.OFF == command) {
logger.debug("Received OFF - Ignored as the TV is already off.");
} else if (powerOn && OnOffType.OFF == command) {
handler.getSocket().powerOff(getDefaultResponseListener());
} else if (OnOffType.OFF == command) {
if (powerOn){
handler.getSocket().powerOff(getDefaultResponseListener());
}else{
logger.debug("Received OFF - Ignored as the TV is already off.");
}

Signed-off-by: Laurent Garnier <[email protected]>
@TravisBuddy
Copy link

Travis tests were successful

Hey @lolodomo,
we found no major flaws with your code. Still you might want to look at this logfile, as we usually suggest some optional improvements.

@lolodomo
Copy link
Contributor Author

lolodomo commented Apr 5, 2020

I added the tag "community approved" as I got a positive feedback on the forum with this change.
https://community.openhab.org/t/lgwebos-binding-for-lg-webos-tvs/4726/732?u=lolodomo

Copy link
Contributor

@cpmeister cpmeister left a comment

Choose a reason for hiding this comment

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

LGTM

@cpmeister cpmeister merged commit 4d6ba4c into openhab:2.5.x Apr 5, 2020
@cpmeister cpmeister added this to the 2.5.4 milestone Apr 5, 2020
@lolodomo lolodomo deleted the lgwebos_power_off branch April 5, 2020 19:23
Hans-Reiner pushed a commit to Hans-Reiner/openhab2-addons that referenced this pull request Apr 11, 2020
…b#7300)

* [lgwebos] Ignore power off command when the TV is already off

Signed-off-by: Laurent Garnier <[email protected]>
Signed-off-by: Hans-Reiner Hoffmann <[email protected]>
@kaikreuzer kaikreuzer added the enhancement An enhancement or new feature for an existing add-on label Apr 19, 2020
yfre pushed a commit to yfre/openhab-addons that referenced this pull request Apr 27, 2020
…b#7300)

* [lgwebos] Ignore power off command when the TV is already off

Signed-off-by: Laurent Garnier <[email protected]>
Signed-off-by: Eugen Freiter <[email protected]>
markus7017 pushed a commit to markus7017/openhab-addons that referenced this pull request May 29, 2020
…b#7300)

* [lgwebos] Ignore power off command when the TV is already off

Signed-off-by: Laurent Garnier <[email protected]>
LoungeFlyZ pushed a commit to LoungeFlyZ/openhab2-addons that referenced this pull request Jun 8, 2020
…b#7300)

* [lgwebos] Ignore power off command when the TV is already off

Signed-off-by: Laurent Garnier <[email protected]>
J-N-K pushed a commit to J-N-K/openhab-addons that referenced this pull request Jul 14, 2020
…b#7300)

* [lgwebos] Ignore power off command when the TV is already off

Signed-off-by: Laurent Garnier <[email protected]>
CSchlipp pushed a commit to CSchlipp/openhab-addons that referenced this pull request Jul 26, 2020
…b#7300)

* [lgwebos] Ignore power off command when the TV is already off

Signed-off-by: Laurent Garnier <[email protected]>
Signed-off-by: CSchlipp <[email protected]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
…b#7300)

* [lgwebos] Ignore power off command when the TV is already off

Signed-off-by: Laurent Garnier <[email protected]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
…b#7300)

* [lgwebos] Ignore power off command when the TV is already off

Signed-off-by: Laurent Garnier <[email protected]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
…b#7300)

* [lgwebos] Ignore power off command when the TV is already off

Signed-off-by: Laurent Garnier <[email protected]>
andrewfg pushed a commit to andrewfg/openhab-addons that referenced this pull request Aug 31, 2020
…b#7300)

* [lgwebos] Ignore power off command when the TV is already off

Signed-off-by: Laurent Garnier <[email protected]>
DaanMeijer pushed a commit to DaanMeijer/openhab-addons that referenced this pull request Sep 1, 2020
…b#7300)

* [lgwebos] Ignore power off command when the TV is already off

Signed-off-by: Laurent Garnier <[email protected]>
Signed-off-by: Daan Meijer <[email protected]>
markus7017 pushed a commit to markus7017/openhab-addons that referenced this pull request Sep 19, 2020
…b#7300)

* [lgwebos] Ignore power off command when the TV is already off

Signed-off-by: Laurent Garnier <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
community approved enhancement An enhancement or new feature for an existing add-on
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants