Nerwyn / android-tv-card

A completely customizable universal remote card for Home Assistant. Supports multiple platforms out of the box.
Apache License 2.0
254 stars 13 forks source link

Search on Kodi broke? #112

Closed houser42 closed 4 months ago

houser42 commented 4 months ago

Hello,

One thing stopped working with the latest 3.9.1 release: The Kodi Search button. The Text input button still works. Downgrading does not fix it so I am wondering if something else has changed? Dependencies perhaps? Have a look when you have a moment? Many thanks.

Here is the error;

Falled to call service remote send command, must contain at east one of entity id, device 1a, area 1a. 
toor 1d label lo

Here is my yaml:

type: custom:android-tv-card
keyboard_id: media_player.kodi
keyboard_mode: KODI
rows:
  - search
custom_keys:
  search:
    icon: mdi:search-web
    icon_height: 18px
    key: SEARCH
button_style:
  '--size': 24px
  '--padding': 0px
card_mod:
  style: |
    ha-card {
      padding: 0px !important;
    }
Nerwyn commented 4 months ago

Hey Houser. I think it's because the text is sending before the search dialog opens in Kodi. I thought I had fixed it during my testing and development but it looks like there wasn't enough time between opening the search page and sending the text. I've moved the open kodi search call to the showDialog function. Can you try the 3.9.2 beta?

Also make sure to try the the keyboard action/button. It now supports Kodi and works better than it does on other platforms!

houser42 commented 4 months ago

Hello @Nerwyn I am a little confused.. When I update from 3.8.2 to 3.9.1 or later, I get the mentioned error. It then does not work to downgrade to any version for some reason.

For now I went back to my backup from a few days ago, that has 3.8.2 and works fine. It seems to me that something in installing 3.9.1 or later breaks the search function. No big deal here, as I am happy at 3.8.2 with my current install albeit curious about the new search... Would be happy to test any new versions when you get around to it? Many thanks!

Nerwyn commented 4 months ago

If downgrading doesn't work then it's definitely a caching issue, which is probably why 3.9.2 didn't work. It should be fixed now that it opens the Kodi search page when the dialog opens, so I'm going to close this issue. Please try 3.9.2 again after clearing cache on your devices.

houser42 commented 4 months ago

Thanks for your suggestion. Clearing cashes does not help so far. I will see if I have broken something else in terms of other addons or dependencies when I have time. At the moment I am stumped and staying at 3.8.2.

houser42 commented 4 months ago

Just checking: I only see 3.9.1 and 3.9.2 beta 001. Is that correct? You mean try the beta?

Nerwyn commented 4 months ago

Yes. There were a few 3.9.2 alpha builds but once I was sure that I fixed this and a few other bugs I deleted them and made a beta build.

houser42 commented 4 months ago

Ok, thanks! Removing some code (specifically the custom key code) makes the search button work again. Could you just tell me how to add back an icon with this new version please? The previous method for adding an icon is not working anymore and I noted that this is being changed at the moment from another similar issue report. Progress!

This is what works now:

type: custom:android-tv-card
entity_id: media_player.kodi
keyboard_id: media_player.kodi
keyboard_mode: KODI
rows:
  - search
button_style:
  '--size': 24px
  '--padding': 0px
  '--icon': mdi:search-web
card_mod:
  style: |
    ha-card {
      padding: 0px !important;
    }
Nerwyn commented 4 months ago

Yeah that would break it. By setting key you're overwriting the default search action. This works for me

  search:
    icon: mdi:kodi
    style:
      color: rgb(9, 179, 232)
      '--size': 64px
houser42 commented 4 months ago

Ok. thanks! I break that wherever I put that in.. Where would that go into my last code just above when/if you have sec..

Nerwyn commented 4 months ago

It's a custom action, it replaces your old kodi search custom action.

type: custom:android-tv-card
keyboard_id: media_player.kodi
keyboard_mode: KODI
rows:
  - search
custom_actions:
  search:
    icon: mdi:kodi
    style:
      color: rgb(9, 179, 232)
      '--size': 18px
button_style:
  '--size': 24px
  padding: 0px
card_mod:
  style: |
    ha-card {
      padding: 0px !important;
    }

FYI custom_keys and custom_sources are deprecated in favor of custom_actions and I don't think icon_height, --padding, or --icon were ever valid values. Please use the README to see which CSS custom attributes are available or use default CSS attributes.

houser42 commented 4 months ago

You're a star. I got lost in breaking changes for a while. All good again. I appreciate you. Thanks for your help!