tuya / tuya-home-assistant

Home Assistant integration for controlling Powered by Tuya (PBT) devices using Tuya Open API, maintained by the Home Assistant Community and Tuya Developer Team.
MIT License
868 stars 206 forks source link

update 1.4 and 1.4.1 breaks the integration. #242

Open RudyDevroey opened 3 years ago

RudyDevroey commented 3 years ago

Deze fout is ontstaan door een aangepaste integratie.

Logger: homeassistant.config_entries Source: custom_components/tuya_v2/init.py:102 Integration: Tuya v2 (documentation) First occurred: 18:16:52 (1 occurrences) Last logged: 18:16:52

Error setting up entry *****@gmail.com for tuya_v2 Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/config_entries.py", line 293, in async_setup result = await component.async_setup_entry(hass, self) # type: ignore File "/config/custom_components/tuya_v2/init.py", line 290, in async_setup_entry success = await _init_tuya_sdk(hass, entry) File "/config/custom_components/tuya_v2/init.py", line 118, in _init_tuya_sdk entry_data = entry_decrypt(hass, entry, init_entry_data) File "/config/custom_components/tuya_v2/init.py", line 102, in entry_decrypt user_input_encrpt = aes.cbc_encrypt(cbc_key, cbc_iv, json.dumps(init_entry_data)) File "/usr/local/lib/python3.9/json/init.py", line 231, in dumps return _default_encoder.encode(obj) File "/usr/local/lib/python3.9/json/encoder.py", line 199, in encode chunks = self.iterencode(o, _one_shot=True) File "/usr/local/lib/python3.9/json/encoder.py", line 257, in iterencode return _iterencode(o, 0) File "/usr/local/lib/python3.9/json/encoder.py", line 179, in default raise TypeError(f'Object of type {o.class.name} ' TypeError: Object of type mappingproxy is not JSON serializable

tsutsuku commented 3 years ago

@RudyDevroey Try v1.4.1 again. We fixed this error this morning.

Damian666 commented 3 years ago

reinstalling 1.4.1 did the trick for me :)

GazTheGeek commented 3 years ago

Was already on 1.4.1 I started having problem last night AEST with my Lovelace buttons not working on an Arlec Tuya smart plug. Node-Red automations were fine as were HomeKit automations but Lovelace buttons did not work. I re-authorised the notification service on Tuya IOT still nothing. So I reinstalled the HACS integration and its all working fine now.

Thanks team for your hard work on this integration it a major game changer! I will be stocking up on Tuya enabled devices as soon as the integration has local access. Thanks

pluskal commented 3 years ago

@tsutsuku, could you please increment the patch number any time you release it?

Rebuilding under the same version number poses difficulty with updates. HACS notifies only on "updates" and does not have a build-in reinstall feature. It may be complicated and worrisome for some people to uninstall and install reinstall a component (e.g., configuration persistence concerns).

zlinoliver commented 3 years ago

@pluskal sorry for the inconvenience, we have released a new tag of v1.4.2 for the bug fix.Please check if it works for you.

pluskal commented 3 years ago

Awesome! Thanks, works like a charm.