There’s really not much going on with code. Each button is basically the same. I’ve drawn the entire picture in Powerpoint and then saved it as a png. I’ve found Powerpoint to be useful because of all the built in icons and the alignment tools are very useful. I created a coloured button (RemoteButton.png), which is just a square shape that I saved as its own png file, and then positioned that over each of the icons. When I was happy with the placement I swapped the coloured button for an invisible one (RemoteButtonClear.png). When I say invisible, I just changed the shape in Powerpoint, so it had no outline or fill, then saved that as a png file. All these images are in the www folder in config. The DPAD cursor type buttons use the code I shared above and the intent buttons (for apps etc) use this code: -
- entity: input_boolean.androidtv
intent: '-n org.xbmc.kodi/.Splash'
The difference is the type of service that is called and ‘key’ is replaced with ‘intent’. You need to follow all the steps of adding the adb addon: -
You also have to add the androidtv.py file to the relevant location and create the media_player entity.
The input_boolean entity is a dummy that allows you to have an element on this card. Everything is actually controlled from the service calls.
Hope that helps.