puttyman / hass-amplifi

A home assistant integration for Ubiquiti Amplifi
31 stars 15 forks source link

Platform not found #32

Closed mm98 closed 1 year ago

mm98 commented 1 year ago

Hi,

I just updated to the lastest version and HA logs started showing the following error. Fixing the indentation error of @property on line 140 resolves the error.

Logger: homeassistant.loader
Source: loader.py:796
First occurred: 06:59:29 (1 occurrences)
Last logged: 06:59:29

Unexpected exception importing platform custom_components.amplifi.device_tracker
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 779, in get_platform
    cache[full_name] = self._import_platform(platform_name)
  File "/usr/src/homeassistant/homeassistant/loader.py", line 796, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
  File "/usr/local/lib/python3.10/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1050, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 879, in exec_module
  File "<frozen importlib._bootstrap_external>", line 1017, in get_code
  File "<frozen importlib._bootstrap_external>", line 947, in source_to_code
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/config/custom_components/amplifi/device_tracker.py", line 141
    def entity_registry_enabled_default(self) -> bool:
IndentationError: unexpected unindent
Logger: homeassistant.setup
Source: setup.py:347
First occurred: 06:59:29 (1 occurrences)
Last logged: 06:59:29

Unable to prepare setup for platform amplifi.device_tracker: Platform not found (Exception importing custom_components.amplifi.device_tracker).

Sadly I can't revert to previous version, since these updates arent seperate releases.

puttyman commented 1 year ago

Hi @mm98 , following my comments on https://github.com/puttyman/hass-amplifi/issues/28#issuecomment-1418467613 . I believe this was cause due to a recent PR being merged.

I have now reverted the one could be causing this problem. Let me know if that works for you. Unfortunately I do not own an Amplify any more and unable to test PRs before merging.

mm98 commented 1 year ago

I have now reverted the one could be causing this problem. Let me know if that works for you. Unfortunately I do not own an Amplify any more and unable to test PRs before merging.

This also works 😊 thanks!