xZetsubou / hass-localtuya

🔹 A Home Assistant integration to handle Tuya devices locally "fork from localtuya"

Home Page:https://xzetsubou.github.io/hass-localtuya/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[Bug]: Error while setting up localtuya platform for climate

YOYONL89 opened this issue · comments

LocalTuya Version

3.2.5.1

Home Assistant Version

2024.3.3

Environment

  • Does the device work using the Home Assistant Tuya Cloud component?
  • Is this device connected to another local integration, including Home Assistant and any other tools?
  • The devices are within the same HA subnet, and they get discovered automatically when I add them

What happened?

During setup i see the climate entity being created although it get the status unavailable.
Also the temps (if i get them) showing are of with one decimal so 40C is displayed as 4,0C.
The reason i selected "Is this device connected to another local integration, including Home Assistant and any other tools?" is that the cloud tuya is there but in the disabled state, dunno if it might be related although i get the feeling its not.

Steps to reproduce.

  1. Add a new Device (Heatpump)
  2. Adding sometimes failles and does not show a new device / adding sometimes succeeds but the device becomes NA after a few seconds and displaying the wrong info?

Relevant log output

Logger: homeassistant.components.climate
Bron: helpers/entity_platform.py:350
integratie: Klimaat (documentation, issues)
First occurred: 23:06:50 (2 gebeurtenissen)
Laatst gelogd: 23:08:59

Error while setting up localtuya platform for climate
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 350, in _async_setup_platform
    await asyncio.shield(awaitable)
  File "/config/custom_components/localtuya/common.py", line 111, in async_setup_entry
    entity_class(
  File "/config/custom_components/localtuya/climate.py", line 195, in __init__
    self._preset_name_to_value = {v: k for k, v in self._preset_set.items()}
                                                   ^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'str' object has no attribute 'items'

Diagnostics information.

image

This has been fixed on beta updates if you added the device with auto discover entities.
If you want to manually fix
Localtuya -> configure -> choose reconfigure existing device -> select your device -> click on submit to processed to climate configuration and remove everything inside the presets

OR Download beta version using HACS and re-add the device again if you configured the entities automatically.

This issue was closed because it was resolved on the release: