No module named 'androidtv'

I have configured the ADB - Android Debug Bridge add on, put my Android TV in developer mode and it seems to be working:

INFO: Starting the Android Debug Bridge server...
INFO: Connecting to device: 192.168.25.144...
connected to 192.168.25.144:5555

I have configured the media player in my configuration.yaml like this:

  - platform: androidtv
    host: 192.168.25.144
    name: "Philips TV"
    adb_server_ip: 127.0.0.1
    adb_server_port: 5037  

It does show this error:

Log Details (ERROR)
Sat Mar 02 2019 20:15:08 GMT+0100 (CET)

Error while setting up platform androidtv
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 128, in _async_setup_platform
    SLOW_SETUP_MAX_WAIT, loop=hass.loop)
  File "/usr/local/lib/python3.7/asyncio/tasks.py", line 416, in wait_for
    return fut.result()
  File "/usr/local/lib/python3.7/concurrent/futures/thread.py", line 57, in run
    result = self.fn(*self.args, **self.kwargs)
  File "/config/custom_components/androidtv/media_player.py", line 171, in setup_platform
    from androidtv import AndroidTV
ModuleNotFoundError: No module named 'androidtv'

@Onandon, I think you know how to refactor this properly (just like XBOX and PS4) :wink:

Never mind, I solved it :wink:

Glad hear, I would have fixed for you tomorrow otherwise :slight_smile:

1 Like

Thanks! I believe the code in media_player.py is okay