RogerSelwyn / Home_Assistant_SkyQ_MediaPlayer

Home Assistant SkyQ Media player component
MIT License
101 stars 17 forks source link

[BUG] Duplicate IDs used when configuring device #125

Closed RogerSelwyn closed 1 year ago

RogerSelwyn commented 1 year ago

Common description to two bug reports - see #123 originally created by @mark007

Describe the bug
When configuring the integration within the HA UI, if I select all the channels/sources for a given skyq instance, some channels will not be selected after I go to reconfigure the integration such as '342 - Sky Comedy HD'. After I reconfigure and select those channels/sources that had not selected and hit 'Submit', the integration shows a flashing 'Initializing' sign in the HA UI and an error is seen in the logs.

To Reproduce
Steps to reproduce the behavior: Try to select all sources for a given integration instance during configuration. (It can take a while, lots of clicks, maybe a possible future improvement ;) )

  1. Where are you (bear in mind component supports GBR/ITA at the moment)? Ireland

Expected behavior
Configuration completes normally.

Screenshots
If applicable, add screenshots to help explain your problem.

Component versions

  1. What version of SkyQ component are you using? v2.9.10

  2. What was the last version where the problem was not shown? As this is my first time using a UI configuration, I have no previous version to compare against.

Your configuration
How have you setup your devices, by UI or YAML? UI.

Output of HA logs

Logger: homeassistant.components.media_player Source: helpers/entity_platform.py:520 Integration: Media Player (documentation, issues) First occurred: 20:36:30 (45 occurrences) Last logged: 20:37:32

Platform skyq does not generate unique IDs. ID IRL04888466641 already exists - ignoring media_player.living_room_sky

Logger: homeassistant.components.sensor Source: helpers/entity_platform.py:520 Integration: Sensor (documentation, issues) First occurred: 20:36:30 (45 occurrences) Last logged: 20:37:32

Platform skyq does not generate unique IDs. ID IRL04888466641_used already exists - ignoring sensor.living_room_sky_used_storage

RogerSelwyn commented 1 year ago

@mark007 - Please report back any findings from the extra debugging to here

mark007 commented 1 year ago

Thanks for this Roger. Did you have another build you wanted me to try or did you also reproduce on your side?

RogerSelwyn commented 1 year ago

I have released a new beta a build which fixes the channel issue you reported. However, you copied in the new files, but never reported back any logging after trying a config change. You said you are going to review it overnight.

These are the steps I suggested, no need to do 1-3 anymore just install v2.9.11:

  1. Go to the Github site and click the code button which will allow you to download a zip file
  2. When downloaded, unzip the file
  3. Copy the contents of custom_components/skyq folder to the custom_components/skyq folder of your HA config
  4. Restart HA
  5. Go to configure the box, change something, click submit, look at the logs and report back

You will need to have the following in your config before you reboot:

  logs:
    custom_components.skyq: debug
RogerSelwyn commented 1 year ago

Ahh, you did, I missed it.

Got ya. I can get logs now after trying to submit in the UI. Logs below are from just now, after reconfiguring my living room sky, skyq integration instance. I selected two of the unselected sources and hit Submit and below was the result.

2022-10-21 18:28:01.399 DEBUG (MainThread) [custom_components.skyq.config_flow] D0010 - Config options flow initiated for: Living Room Sky, 192.168.86.23, IRL04888466641 2022-10-21 18:28:12.451 DEBUG (MainThread) [custom_components.skyq] D0020 - Unload 192.168.86.23, IRL04888466641 2022-10-21 18:28:12.604 DEBUG (MainThread) [custom_components.skyq] D0030 - Unload OK 192.168.86.23, IRL04888466641 2022-10-21 18:28:12.604 DEBUG (MainThread) [custom_components.skyq] D0010 - Load 192.168.86.23, IRL04888466641

When I look at this I see no problem. The entities unload OK, and I don't see any warning about duplicate IDs, so I assume you don't have that problem any more.

mark007 commented 1 year ago

Oh yeah I don't get duplicate IDs using the UI configuration mode, only using yaml mode (which I no longer use personally). Now that I'm on UI the only remaining bug I notice is the inability to select all channels in the UI configuration.

RogerSelwyn commented 1 year ago

Now that I'm on UI the only remaining bug I notice is the inability to select all channels in the UI configuration.

Which should be fixed with v2.9.11

RogerSelwyn commented 1 year ago

Fixed with - https://github.com/RogerSelwyn/Home_Assistant_SkyQ_MediaPlayer/releases/tag/v2.9.11