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

Unable to prepare setup for platform 'xiaomi_gateway3.climate': Platform not found #1252

Closed
Joery opened this issue Jan 5, 2024 · 1 comment
Labels
duplicate This issue or pull request already exists

Comments

@Joery
Copy link

Joery commented Jan 5, 2024

Hi,

Since the update to Home Assistant 2024.1.0, I'm getting errors when trying to load the integration:

The following integrations and platforms could not be set up:

xiaomi_gateway3.climate ([Show logs](https://xxx/config/logs?filter=xiaomi_gateway3.climate))
xiaomi_gateway3.sensor ([Show logs](https://xxx/config/logs?filter=xiaomi_gateway3.sensor))
Please check your config and [logs](https://xxx/config/logs).

Details:

Logger: homeassistant.setup
Source: setup.py:403
First occurred: 03:03:29 (4 occurrences)
Last logged: 10:52:39

Unable to prepare setup for platform 'xiaomi_gateway3.climate': Platform not found (Exception importing custom_components.xiaomi_gateway3.climate).
Unable to prepare setup for platform 'xiaomi_gateway3.sensor': Platform not found (Exception importing custom_components.xiaomi_gateway3.sensor).

Sensor error:

Logger: homeassistant.loader
Source: loader.py:842
First occurred: 03:03:31 (2 occurrences)
Last logged: 10:52:39

Unexpected exception importing platform custom_components.xiaomi_gateway3.sensor
Traceback (most recent call last):
  File "/lsiopy/lib/python3.11/site-packages/homeassistant/loader.py", line 842, in get_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/homeassistant/loader.py", line 859, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/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/xiaomi_gateway3/sensor.py", line 42, in <module>
    "power": POWER_WATT,
             ^^^^^^^^^^
NameError: name 'POWER_WATT' is not defined

Climate error:

Logger: homeassistant.loader
Source: loader.py:842
First occurred: 03:03:29 (2 occurrences)
Last logged: 10:52:39

Unexpected exception importing platform custom_components.xiaomi_gateway3.climate
Traceback (most recent call last):
  File "/lsiopy/lib/python3.11/site-packages/homeassistant/loader.py", line 842, in get_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/lsiopy/lib/python3.11/site-packages/homeassistant/loader.py", line 859, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/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/xiaomi_gateway3/climate.py", line 14, in <module>
    HVAC_MODE_OFF: CURRENT_HVAC_OFF,
    ^^^^^^^^^^^^^
NameError: name 'HVAC_MODE_OFF' is not defined

I'm using the Xiaomi Gateway 3 (ZNDMWG03LM) with the latest 3.3.4 version of this integration.

@RikardzPT
Copy link

RikardzPT commented Jan 5, 2024

Hello,
Duplicated issue

There's already a patch for it. (just a little search).

#1245 (comment)

@Joery Joery closed this as completed Jan 5, 2024
@AlexxIT AlexxIT added the duplicate This issue or pull request already exists label Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants