smartHomeHub / SmartIR

Integration for Home Assistant to control climate, TV and fan devices via IR/RF controllers (Broadlink, Xiaomi, MQTT, LOOKin, ESPHome)
MIT License
2.06k stars 1.01k forks source link

ImportError: cannot import name 'MediaPlayerEntity' #363

Closed shammysha closed 4 years ago

shammysha commented 4 years ago

Home Assistant 0.109.6 SmartIR 1.11.0

yaml

smartir:
  check_updates: false

media_player:
  - platform: smartir
    name: GS_B528_bigroom
    unique_id: gs_b528_bigroom
    device_code: 999999
    controller_data: remote.ir_bigroom
    source_names:
      TRICOLOR: 'Триколор ТВ'
      CINEMA: 'Кино'
      BIGTV: 'Большое кино'
      TVGID: 'Телегид'
      RADIO: 'Радио'

Json

{
  "manufacturer":"General Satellite",
  "supportedModels":["b528"],
  "supportedController":"Xiaomi",
  "commandsEncoding":"Raw",
  "commands":{
    "off":"nMwmMwlk0mk4mEsmoAZzQAfwB/AH8AfpuAGU1AX8AeZjNgHDAY8AfwB/AH8AfwYPAI8AjwCPAI8AgphAAA==",
    "on":"nMwmMwlk0mk4mEsmoAZzQAfwB/AH8AfpuAGU1AX8AeZjNgHDAY8AfwB/AH8AfwYPAI8AjwCPAI8AgphAAA==",
    "previousChannel":"nMwmMwlk0mk4mEsmoAZzQAfwB2moC/gD+AP4A/gDrMZsCR4EHgQJNgA2AxwAdgEPBC8GvwEPAQ8AjwCFmEAA",
    "nextChannel":"nMwmMwlk0mk4mEsmoAZzQAfpuAGU1AX8AfwB/AH8AeZjNgTDAY8CDwEPAQ8DrwB/Ao8BDwEPAI8AgphAAA==",
    "volumeDown":"nMwmMwlk0mk4mEsmoAZzQAdpqAfwA/gD+AP4A/gntMZsCx4A/gD+Bf4A/AoeAhIBHgEeB74CGzCAAA==",
    "volumeUp":"nMwmMwlk0mk4mEsmoAZzQAfwB/AH8AfwB/AH2YzaagMeBB4EDAEeAR4HngDpNwAyAbMBfwB/Bs8Aj5hLJhAA",
    "mute":"nMwmMwlk0mk4mEsmoAZzQAfwB/AH8AfwB/AH2YzaagMeAO03ADIBswF/A48EHwB/Ap8DLwKvAI8AhphAAA==",
    "sources":{
      "TRICOLOR":"nE5nEwlk0mk1mEsms2ADKcgBlMwAym4B7AD+AP4A/gD+AP0xmwMBgMeECU1CAYCDwB/AH8AfwafAI8AjwCPAIeYQAA==",
      "CINEMA":"nE5nMwlk0mswmEsms2AD8APwA/AD8APwA/mEsmM2m4CngQeBAwFPgIeAx4DHgQeAh4DPgIdMIAA=",
      "BIGTV":"nE5nEwlk0mk1mEsms2ADKbgD+APs2mAA5TMBfwB2BIKagj+A/0xmwDHggeCBYB7gceAPcxm05AQ8BAwMrAi0BnwGfAQWYQA=",
      "TVGID":"nMwmEwlk0mkzmEsms4ADKagD+AP4A/gD+AP4A+zGbTcBjwIPAgYCnwGfA78AfwOfAY8FLwCOmEAA",
      "RADIO":"nE5nEwlk0mk1mEsms2ADKbgBkAgU1APsAfwH3An8AfwB/AvKYzYEjwQOmM2nICHgIMAz4A/gD+Bh4DHgEeARswgA"
    }
  }
}

Got error...

ERROR (MainThread) [homeassistant.config] Platform error: media_player
Traceback (most recent call last):
  File "/var/www/homeassistant/lib/python3.8/site-packages/homeassistant/config.py", line 777, in async_process_component_config
    platform = p_integration.get_platform(domain)
  File "/var/www/homeassistant/lib/python3.8/site-packages/homeassistant/loader.py", line 278, in get_platform
    cache[full_name] = importlib.import_module(
  File "/usr/local/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/var/lib/asterisk/.homeassistant/custom_components/smartir/media_player.py", line 8, in <module>
    from homeassistant.components.media_player import (
ImportError: cannot import name 'MediaPlayerEntity' from 'homeassistant.components.media_player' (/var/www/homeassistant/lib/python3.8/site-packages/homeassistant/components/media_player/__init__.py)
vassilis-panos commented 4 years ago

Hi, please install the appropriate release. https://github.com/smartHomeHub/SmartIR/releases

shammysha commented 4 years ago

I'm Sorry. I I updated homeassistant. Now all works fine! Thank You for plugin