jason0x43 / hacs-hubitat

A Hubitat integration for Home Assistant
MIT License
189 stars 46 forks source link

Hubitat integration not loading #232

Closed capritzl closed 6 months ago

capritzl commented 6 months ago

Core: 2024.1.0b0 Supervisor: 2023.12.0 Operating System: 11.3.rc1 Frontend: 20231227.0

Hubitat integration is not loading. Here is the log message. IMG_2858

Home Assistant Core

Error occurred loading flow for integration hubitat: Exception importing custom_components.hubitat.config_flow 9:03:48 AM – (ERROR) config_entries.py Unexpected exception importing platform custom_components.hubitat.config_flow 9:03:48 AM – (ERROR) loader.py Setup failed for custom integration 'hubitat': Unable to import component: Exception importing custom_components.hubitat 8:31:02 AM – (ERROR) setup.py Unexpected exception importing component custom_components.hubitat 8:31:02 AM – (ERROR) loader.py

mwhdc commented 6 months ago

This looks like a Home Assistant issue. The log mentions certain functions being deprecated a year from now, but then the integration fails to load, which seems unintended. The Dahua camera integration in HACS is throwing a similar error.

2023-12-28 16:52:29.781 WARNING (MainThread) [homeassistant.components.alarm_control_panel] SUPPORT_ALARM_ARM_AWAY was used from hubitat, this is a deprecated constant which will be removed in HA Core 2025.1. Use AlarmControlPanelEntityFeature.ARM_AWAY instead, please create a bug report at https://github.com/jason0x43/hacs-hubitat/issues
2023-12-28 16:52:29.783 WARNING (MainThread) [homeassistant.components.alarm_control_panel] SUPPORT_ALARM_ARM_HOME was used from hubitat, this is a deprecated constant which will be removed in HA Core 2025.1. Use AlarmControlPanelEntityFeature.ARM_HOME instead, please create a bug report at https://github.com/jason0x43/hacs-hubitat/issues
2023-12-28 16:52:29.785 WARNING (MainThread) [homeassistant.components.alarm_control_panel] SUPPORT_ALARM_ARM_NIGHT was used from hubitat, this is a deprecated constant which will be removed in HA Core 2025.1. Use AlarmControlPanelEntityFeature.ARM_NIGHT instead, please create a bug report at https://github.com/jason0x43/hacs-hubitat/issues
2023-12-28 16:52:29.786 WARNING (MainThread) [homeassistant.components.alarm_control_panel] SUPPORT_ALARM_TRIGGER was used from hubitat, this is a deprecated constant which will be removed in HA Core 2025.1. Use AlarmControlPanelEntityFeature.TRIGGER instead, please create a bug report at https://github.com/jason0x43/hacs-hubitat/issues
2023-12-28 16:52:29.788 WARNING (MainThread) [homeassistant.components.alarm_control_panel] SUPPORT_ALARM_ARM_AWAY was used from hubitat, this is a deprecated constant which will be removed in HA Core 2025.1. Use AlarmControlPanelEntityFeature.ARM_AWAY instead, please create a bug report at https://github.com/jason0x43/hacs-hubitat/issues
2023-12-28 16:52:29.789 WARNING (MainThread) [homeassistant.components.alarm_control_panel] SUPPORT_ALARM_ARM_HOME was used from hubitat, this is a deprecated constant which will be removed in HA Core 2025.1. Use AlarmControlPanelEntityFeature.ARM_HOME instead, please create a bug report at https://github.com/jason0x43/hacs-hubitat/issues
2023-12-28 16:52:29.791 WARNING (MainThread) [homeassistant.components.alarm_control_panel] SUPPORT_ALARM_ARM_NIGHT was used from hubitat, this is a deprecated constant which will be removed in HA Core 2025.1. Use AlarmControlPanelEntityFeature.ARM_NIGHT instead, please create a bug report at https://github.com/jason0x43/hacs-hubitat/issues
2023-12-28 16:52:29.792 WARNING (MainThread) [homeassistant.components.alarm_control_panel] SUPPORT_ALARM_TRIGGER was used from hubitat, this is a deprecated constant which will be removed in HA Core 2025.1. Use AlarmControlPanelEntityFeature.TRIGGER instead, please create a bug report at https://github.com/jason0x43/hacs-hubitat/issues
2023-12-28 16:52:29.805 ERROR (MainThread) [homeassistant.loader] Unexpected exception importing component custom_components.hubitat
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 822, in get_component
    ComponentProtocol, importlib.import_module(self.pkg_path)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1204, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1176, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1147, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 690, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 940, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/hubitat/__init__.py", line 9, in <module>
    from custom_components.hubitat.services import (
  File "/config/custom_components/hubitat/services.py", line 11, in <module>
    from .alarm_control_panel import HubitatSecurityKeypad
  File "/config/custom_components/hubitat/alarm_control_panel.py", line 23, in <module>
    from .device import HubitatEntity
  File "/config/custom_components/hubitat/device.py", line 133, in <module>
    class HubitatEntity(HubitatBase, UpdateableEntity):
TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases
LindsayReid commented 6 months ago

Log Details (ERROR) Logger: homeassistant.setup Source: setup.py:251 First occurred: 00:25:51 (1 occurrences) Last logged: 00:25:51

Setup failed for custom integration 'hubitat': Unable to import component: Exception importing custom_components.hubitat Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/loader.py", line 822, in get_component ComponentProtocol, importlib.import_module(self.pkg_path) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.11/importlib/init.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "", line 1204, in _gcd_import File "", line 1176, in _find_and_load File "", line 1147, in _find_and_load_unlocked File "", line 690, in _load_unlocked File "", line 940, in exec_module File "", line 241, in _call_with_frames_removed File "/config/custom_components/hubitat/init.py", line 9, in from custom_components.hubitat.services import ( File "/config/custom_components/hubitat/services.py", line 11, in from .alarm_control_panel import HubitatSecurityKeypad File "/config/custom_components/hubitat/alarm_control_panel.py", line 23, in from .device import HubitatEntity File "/config/custom_components/hubitat/device.py", line 133, in class HubitatEntity(HubitatBase, UpdateableEntity): TypeError: metaclass conflict: the metaclass of a derived class must be a (non-strict) subclass of the metaclasses of all its bases

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 251, in _async_setup_component component = integration.get_component() ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/loader.py", line 830, in get_component raise ImportError(f"Exception importing {self.pkg_path}") from err ImportError: Exception importing custom_components.hubitat

mwhdc commented 6 months ago

Looks like HA introduced this issue in many integrations in 2024.1.0b1 and tried to fix in b2. The Hubitat integration still throws the same error(s) and fails to load.

https://github.com/home-assistant/core/pull/106619

jason0x43 commented 6 months ago

This should be fixed in v0.9.9.

capritzl commented 6 months ago

Works again. Thanks.