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

[samsungtv] Fix IllegalStateException on sourceName command #16787

Merged
merged 1 commit into from
May 22, 2024

Conversation

NickWaterton
Copy link
Contributor

Title

This PR fixes #16783

additional testing preferred

Signed-off-by: Nick Waterton <n.waterton@outlook.com>
@jlaur jlaur added bug An unexpected problem or unintended behavior of an add-on additional testing preferred The change works for the pull request author. A test from someone else is preferred though. labels May 22, 2024
@jlaur
Copy link
Contributor

jlaur commented May 22, 2024

@NickWaterton - thanks! This is the result of my first test:

2024-05-22 18:23:16.310 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'SamsungTV_SourceName' received command HDMI1/DVI
2024-05-22 18:23:16.312 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'SamsungTV_SourceName' predicted to become HDMI1/DVI
2024-05-22 18:23:16.313 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'SamsungTV_SourceName' changed from HDMI-CEC to HDMI1/DVI
2024-05-22 18:23:16.318 [WARN ] [internal.service.MainTVServerService] - 192.168.0.41: Command execution failed, result='NOTOK_NotConnected'
2024-05-22 18:23:16.324 [WARN ] [internal.service.MainTVServerService] - 192.168.0.41: main tvservice: command error HDMI1/DVI channel sourceName
2024-05-22 18:23:16.324 [WARN ] [tv.internal.handler.SamsungTvHandler] - 192.168.0.41: Channel 'sourceName' not connected/supported

I'll try to have a closer look later.

@jlaur jlaur changed the title [samsungtv] fix input change bug #16783 [samsungtv] Fix IllegalStateException on sourceName command May 22, 2024
@jlaur jlaur added the regression Regression that happened during the development of a release. Not shown on final release notes. label May 22, 2024
@jlaur
Copy link
Contributor

jlaur commented May 22, 2024

I did another test, and it seems to be working. Maybe I enabled HDMI-CEC on the TV since I was last using the sourceName channel, and this seems to cause some confusion for me. Latest result:

2024-05-22 22:29:43.957 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'SamsungTV_SourceName' received command HDMI2
2024-05-22 22:29:43.957 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'SamsungTV_SourceName' predicted to become HDMI2
2024-05-22 22:29:43.958 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'SamsungTV_SourceName' changed from TV to HDMI2
2024-05-22 22:29:43.961 [DEBUG] [tv.internal.handler.SamsungTvHandler] - 192.168.0.41: Received channel: samsungtv:tv:office:sourceName, command: HDMI2
2024-05-22 22:29:43.961 [TRACE] [tv.internal.handler.SamsungTvHandler] - 192.168.0.41: Received: sourceName, command: HDMI2
2024-05-22 22:29:43.961 [TRACE] [internal.service.MainTVServerService] - 192.168.0.41: getSupportedChannelNames: [sourceName, sourceId, url, stopBrowser]
2024-05-22 22:29:43.961 [TRACE] [internal.service.MainTVServerService] - 192.168.0.41: Received channel: sourceName, command: HDMI2
2024-05-22 22:29:44.089 [DEBUG] [tv.internal.handler.SamsungTvHandler] - 192.168.0.41: Received value 'sourceName':'HDMI2' for thing 'samsungtv:tv:office'
2024-05-22 22:29:44.252 [TRACE] [internal.service.MainTVServerService] - 192.168.0.41: Received channel: sourceName, command: REFRESH
2024-05-22 22:29:45.262 [TRACE] [internal.service.MainTVServerService] - 192.168.0.41: Received channel: sourceName, command: REFRESH
2024-05-22 22:29:45.265 [DEBUG] [tv.internal.handler.SamsungTvHandler] - 192.168.0.41: Received value 'sourceName':'HDMI-CEC' for thing 'samsungtv:tv:office'
2024-05-22 22:29:45.266 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'SamsungTV_SourceName' changed from HDMI2 to HDMI-CEC

I tried to get back to the 4.1 binding, and it has similar behavior.

The previous test where I changed source to "HDMI1/DVI" and received "Command execution failed, result='NOTOK_NotConnected'" also behaves like this in the previous version. This is probably because the HDMI device is off, so the "HDMI1/DVI" input is not available on-screen either.

Instead I can select the corresponding "HDMI-CEC" device on-screen, which will then turn on the device. This cannot be done by the binding because there are two HDMI-CEC sources. However, this works like in the previous binding, and I wouldn't know how to distinguish them from one another.

Copy link
Contributor

@jlaur jlaur left a comment

Choose a reason for hiding this comment

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

LGTM

@jlaur jlaur merged commit 7394ba0 into openhab:main May 22, 2024
5 checks passed
@jlaur jlaur added this to the 4.2 milestone May 22, 2024
@NickWaterton NickWaterton deleted the samsungtv-bugfix branch May 22, 2024 20:58
psmedley pushed a commit to psmedley/openhab-addons that referenced this pull request Jun 15, 2024
Signed-off-by: Nick Waterton <n.waterton@outlook.com>
Signed-off-by: Paul Smedley <paul@smedley.id.au>
@jlaur jlaur removed the additional testing preferred The change works for the pull request author. A test from someone else is preferred though. label Jun 30, 2024
pgfeller pushed a commit to pgfeller/openhab-addons that referenced this pull request Sep 29, 2024
Signed-off-by: Nick Waterton <n.waterton@outlook.com>
Signed-off-by: Patrik Gfeller <patrik.gfeller@proton.me>
joni1993 pushed a commit to joni1993/openhab-addons that referenced this pull request Oct 15, 2024
Signed-off-by: Nick Waterton <n.waterton@outlook.com>
matchews pushed a commit to matchews/openhab-addons that referenced this pull request Oct 18, 2024
Signed-off-by: Nick Waterton <n.waterton@outlook.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An unexpected problem or unintended behavior of an add-on regression Regression that happened during the development of a release. Not shown on final release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[samsungtv] Exception thrown when changing input source on legacy TV
2 participants