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

Localtuya 4.0 #829

Merged
merged 45 commits into from
Jun 13, 2022
Merged

Localtuya 4.0 #829

merged 45 commits into from
Jun 13, 2022

Conversation

rospogrigio
Copy link
Owner

@rospogrigio rospogrigio commented May 23, 2022

Major change in Localtuya. Here's what's new:

  • one single integration instead of one integration for each device
  • introduced Cloud API connection (for local key retrieval)
  • auto-update of local keys (in case of re-pairing of a device)
  • introduced diagnostics, both for the Integration and for each device
  • removed YAML configuration (since it's being deprecated almost everywhere)

@CloCkWeRX
Copy link

CloCkWeRX commented Jun 5, 2022

Updated round of testing (WIP/will keep editing comments here)...

Version: 2022.5.5

Merged to https://github.com/CloCkWeRX/localtuya-experimental
Cleared logs
Restarted....

Previous errors - largely gone.

Config entry has already been setup!

I don't know this is related to the changes in this PR, or if I simply have two devices that look very similar that trigger this.

Maybe a variant of what #100 addressed?

Logger: homeassistant.config_entries
Source: helpers/entity_component.py:157
First occurred: 12:00:07 PM (5 occurrences)
Last logged: 12:00:07 PM

Error setting up entry localtuya for switch
Error setting up entry localtuya for light
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 335, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/usr/src/homeassistant/homeassistant/components/switch/__init__.py", line 81, in async_setup_entry
    return await component.async_setup_entry(entry)
  File "/usr/src/homeassistant/homeassistant/helpers/entity_component.py", line 157, in async_setup_entry
    raise ValueError("Config entry has already been setup!")
ValueError: Config entry has already been setup!

Template sensors

I think this is probably me with outdated configuration, rather than specific changes here.

Logger: homeassistant.helpers.template
Source: helpers/template.py:1879
First occurred: 12:00:29 PM (2 occurrences)
Last logged: 12:00:29 PM

Template variable error: 'None' has no attribute 'attributes' when rendering '{{ states.switch.pc191ha.attributes.current_consumption }}'

Labels

Now showing up :)

image

No cloud fallback behaviour

Can't really test as I can't remove details.

@CloCkWeRX
Copy link

Alright, seems good to go IMO on both this month and last month's HA install. @rospogrigio merge away!

@rospogrigio
Copy link
Owner Author

Alright, seems good to go IMO on both this month and last month's HA install. @rospogrigio merge away!

Not yet, I realized that you can't actually add the Integration without configuring the cloud credentials, I am adding an option for this, then I think it's merging time. Thank you for the precious review!

@rospogrigio
Copy link
Owner Author

OK @CloCkWeRX I think I'm ready for release, can you please do some more checks and approve the review? I just added a button to choose not to setup the Cloud API account. Thank you!

@rospogrigio
Copy link
Owner Author

@CloCkWeRX can you please review the new commits and approve it when you find the time? I will then release the new code.
Thank you!

@CloCkWeRX
Copy link

LGTM - I can't re-add an approving review/I'm not core so it doesn't pass the "At least 1 approving review is required by reviewers with write access." check, but merge away

Copy link

@smarthomefamilyverrips smarthomefamilyverrips left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@regevbr regevbr mentioned this pull request Jun 13, 2022
@rospogrigio rospogrigio merged commit cada522 into master Jun 13, 2022
@rospogrigio rospogrigio deleted the localtuya_4.0 branch June 13, 2022 22:09
@regevbr
Copy link

regevbr commented Jun 14, 2022

Nice! When can we expect a release?

@rospogrigio
Copy link
Owner Author

Nice! When can we expect a release?

Just did it, check it and enjoy! 😉

@regevbr
Copy link

regevbr commented Jun 14, 2022

Works flawlessly for me :-) thank you so much!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants