RogerSelwyn / Home_Assistant_SkyQ_MediaPlayer

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

Error in LOG #93

Closed dodor87 closed 2 years ago

dodor87 commented 2 years ago

All works correctly but i've the following error in log :

2022-02-27 12:31:27 ERROR (MainThread) [homeassistant.helpers.entity] Update for media_player.skyq_salone fails Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 521, in async_update_ha_state await self.async_device_update() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 725, in async_device_update raise exc File "/config/custom_components/skyq/media_player.py", line 334, in async_update SwitchMaker( File "/config/custom_components/skyq/classes/switchmaker.py", line 64, in __init__ self._add_switch(channel, channel, "select_source", True) File "/config/custom_components/skyq/classes/switchmaker.py", line 70, in _add_switch source_switch = switch.replace("'", "''") AttributeError: 'int' object has no attribute 'replace'

Expected behavior
A clear and concise description of what you expected to happen.

Component versions

  1. What version of SkyQ component are you using?
  2. What was the last version where the problem was not shown?

Latest

Your configuration from the options dialogue
or
Your configuration.yaml


  - platform:  skyq
    name: SkyQ Salone
    host: 192.168.0.161
    generate_switches_for_channels: true
    live_tv: True
    sources:
      CHup: 'channelup'                                                         #added
      CHdn: 'channeldown'                                                       #added
      Select: 'select'                                                          #added
      Up: 'up'                                                                  #added
      Down: 'down'                                                              #added
      Left: 'left'                                                              #added
      Right: 'right'                                                            #added
      I: 'i'                                                                    #added
      Dismiss: 'dismiss'                                                        #added
      Sidebar: 'Sidebar'                                                        #added
      Home: 'home'                                                              #added
      TVGuide: 'tvguide'                                                        #added
      Sky: 'sky'                                                                #added
      Record: 'record'   
      0: '0'
      1: '1'
      2: '2'
      3: '3'
      4: '4'
      5: '5'
      6: '6'
      7: '7'
      8: '8'
      9: '9'
RogerSelwyn commented 2 years ago

I suspect it is because you have used integer source names, which I can handle. However it seems odd to use those button press names as sources, is this so you can say the names to Alexa? In which case why are you using shortened names in English when I’m guessing you may be Italian with a room name of SkyQ Salone?

dodor87 commented 2 years ago

I find the bug/error: the correct config for number of channel is with "string" / name and not number:

Zero: '0' One: '1' Two: '2' Three: '3' Four: '4' Five: '5' Six: '6' Seven: '7' Eight: '8' Nine: '9'

With name no problem sir