Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changes for custom components made in Home Assistant 0.88 #2

Merged
merged 3 commits into from Feb 22, 2019
Merged

Changes for custom components made in Home Assistant 0.88 #2

merged 3 commits into from Feb 22, 2019

Conversation

sechsbug
Copy link

Home Assistant made some changes in Version 0.88 for custom components.

Fixes this error:

Traceback (most recent call last): File “/usr/local/lib/python3.7/site-packages/homeassistant/loader.py”, line 147, in _load_file module = importlib.import_module(path) File “/usr/local/lib/python3.7/importlib/init.py”, line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File “<frozen importlib._bootstrap>”, line 1006, in _gcd_import File “<frozen importlib._bootstrap>”, line 983, in _find_and_load File “<frozen importlib._bootstrap>”, line 962, in _find_and_load_unlocked ModuleNotFoundError: No module named ‘custom_components.enigma.media_player’; ‘custom_components.enigma’ is not a package

Further information:
New file structure
New Location of media_player constants

@sechsbug sechsbug changed the title Changes for custom components mad in Home Assistant 0.88 Changes for custom components made in Home Assistant 0.88 Feb 21, 2019
@onkelbeh
Copy link

onkelbeh commented Feb 22, 2019

Thanks, i renamed the two files and applied the lib changes by hand, looks much better, but with v0.88.1 it logs:

2019-02-22 17:14:09 WARNING (MainThread) [homeassistant.loader] You are using a custom component for enigma.media_player which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-02-22 17:14:10 WARNING (MainThread) [homeassistant.loader] You are using a custom component for enigma which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-02-22 17:14:10 ERROR (MainThread) [homeassistant.setup] Error during setup of component enigma
Traceback (most recent call last):
  File "/usr/lib64/python3.6/site-packages/homeassistant/setup.py", line 151, in _async_setup_component
    hass, processed_config)
  File "/etc/homeassistant/custom_components/enigma/__init__.py", line 91, in async_setup
    configured_devices = config[DOMAIN].get(CONF_DEVICES)
KeyError: 'enigma'

2019-02-22 17:14:10 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of enigma.media_player. Setup failed for dependencies: enigma
2019-02-22 17:14:10 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform enigma.media_player: Could not set up all dependencies.
2019-02-22 17:14:10 ERROR (MainThread) [homeassistant.setup] Unable to set up dependencies of enigma.media_player. Setup failed for dependencies: enigma
2019-02-22 17:14:10 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform enigma.media_player: Could not set up all dependencies.

My /etc/homeassistant/media_player/enigma.yaml looks like this:


- platform: enigma
  host: 172.16.2.149
  port: 80
  name: dream_wz
  icon: mdi:satellite-variant
  timeout: 20
  username: root
  password: !secret enigma_password

- platform: enigma
  host: 172.16.2.150
  port: 80
  name: dream_k
  icon: mdi:satellite-variant
  timeout: 20
  username: root
  password: !secret enigma_password

The Dreamboxes show up in red boxes:
grafik

Sorry, but i didn't try it with v0.88.0.

custom_components/
├── enigma
│   ├── __init__.py
│   ├── media_player.py
│   └── __pycache__
│       ├── __init__.cpython-36.pyc
│       └── media_player.cpython-36.pyc
├── notify
│   └── enigma.py
└── samsungtv
    ├── media_player.py
    ├── __pycache__
    │   └── media_player.cpython-36.pyc
    ├── samsungtv.0810
    ├── samsungtv.off
    └── samsungtv.off2

@adrianmihalko
Copy link

There is problem with volume control, on the device itself the volume is set correctly, but in Home Assistant:

https://www.youtube.com/watch?v=JwpVO49V-WY

@adrianmihalko
Copy link

screenshot 2019-02-22 at 19 26 07

@adrianmihalko
Copy link

Maybe this is related?

2019-02-22 19:27:56 WARNING (MainThread) [homeassistant.loader] You are using a custom component for enigma.media_player which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you do experience issues with Home Assistant.
2019-02-22 19:27:57 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 344, in _async_add_entity
    raise HomeAssistantError(msg)

@sechsbug
Copy link
Author

@onkelbeh I think your problem is in the config of your devices. Set it up like its mentioned in the readme and you should be good to go

Like this:

enigma: 
  devices:
    - host: 172.16.2.149
      port: 80
      name: dream_wz
      timeout: 20
      username: root
      password: !secret enigma_password

    - host: 172.16.2.150
      port: 80
      name: dream_k
      icon: mdi:satellite-variant
      timeout: 20
      username: root
      password: !secret enigma_password

@adrianmihalko I think there is just a little delay until Home Assistant displays the correct volume. I didn´t change anything than the file structure and the new libaries, so the volume control should not got broken by this change.

@adrianmihalko
Copy link

I must check what cause the delay, because it was worked perfectly before. 🤷‍♂️

@cinzas cinzas merged commit fdad38c into cinzas:master Feb 22, 2019
@onkelbeh
Copy link

@sechsbug
Yes, i moved the config into configurations.yaml. No loads and works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants