DCSBL / ha-homewizard-energy

The old custom Home Assistant integration for HomeWizard Energy. This integration is now available in Core.
https://community.home-assistant.io/t/custom-component-homewizard-energy-wifi-p1-meter-and-kwh-meter/227441
Apache License 2.0
26 stars 3 forks source link

Installatie probleem; 'type' object is not subscriptable #42

Closed ibl129 closed 3 years ago

ibl129 commented 3 years ago

In Home Assistant komen na de instalaltie van 0.8.2 de sensor niet meer 'up'. Als foutmelding krijg ik:

_Logger: homeassistant.config_entries Source: custom_components/homewizardenergy/sensor.py:61 Integration: Homewizard Energy (documentation, issues) First occurred: 7:53:06 (1 occurrences) Last logged: 7:53:06

Error setting up entry P1 meter for sensor
Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/config_entries.py", line 293, in async_setup
    result = await component.async_setup_entry(hass, self)  # type: ignore
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/components/sensor/__init__.py", line 90, in async_setup_entry
    return await component.async_setup_entry(entry)
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/helpers/entity_component.py", line 149, in async_setup_entry
    platform = await async_prepare_setup_platform(
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/setup.py", line 329, in async_prepare_setup_platform
    platform = integration.get_platform(domain)
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/loader.py", line 498, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/srv/homeassistant/lib/python3.8/site-packages/homeassistant/loader.py", line 503, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  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 "/home/homeassistant/.homeassistant/custom_components/homewizard_energy/sensor.py", line 61, in <module>
    SENSORS: Final[list[SensorEntityDescription]] = [
TypeError: 'type' object is not subscriptable

Verscheidene herstarts gedaan na installatie; geen effect.

DCSBL commented 3 years ago

This is a bit weird. I think/hope is it has something to do with a wrong python version. Can you go to your Home Assistant Frontend -> Configuration -> Info (use the copy button in the System Health block), and paste the information here?

DCSBL commented 3 years ago

It looks like that https://github.com/cyberjunky/home-assistant-toon_smartmeter/issues/23 has the same issue as well, and it seems that is in the same context.

DCSBL commented 3 years ago

Issue should be solved with 0.9.0-beta-5 (or later). Can you please validate that for me?