#๐Ÿ‘‹๐Ÿผ I'm playing with adding some Tuya

1 messages ยท Page 1 of 1 (latest)

unkempt adder
#

Related question - is anyone able to run pre-commit run --all-files locally? For me it's hanging on pylint

unkempt adder
#

Here's some git scripting in case it's helpful to anyone else:

cd /root/homeassistant/custom_components
mkdir core
cd core
git init
git remote add -f origin https://github.com/EvanSchalton/core.git
git config core.sparseCheckout true
echo "homeassistant/components/tuya/" >> .git/info/sparse-checkout
git pull origin master

mv /root/homeassistant/custom_components/core/homeassistant/components/tuya/ /root/homeassistant/custom_components/tuya

rm -r /root/homeassistant/custom_components/core
unkempt adder
#

Welp, that's the wrong thing -- it's being recognized as a custom component, but won't load

unkempt adder
#

This is interesting the async_setup_entry ConfigEntry is being sent the refresh token instead of the API connection details

opal hollow
#

๐Ÿ‘‹๐Ÿผ I'm playing with adding some Tuya components and want to run the code on my server for integration testing - my understanding is I can clone the Tyua directory from my fork into a custom components and restart the server and it'll load my code instead of the core package -- if that's not correct / there's a better way please let me know.
Set up a development environment to test and develop, as documented in our developer documentation.

opal hollow
opal hollow
unkempt adder
#

Yeah, I stopped running on everything. Re not using a custom_component - what's the preferred method? I didn't see relevant docs and tried to run home assistant in the dev container and it hangs

opal hollow
#

to run HA in a dev env: just hit F5 to start Home Assistant in the vscode debugger

unkempt adder
#

Ahh cool okay, thanks

#

Is there a straight forward way to load data from a home assistant backup? It'd be great to not have to reconfigure things for testing

opal hollow
#

but in general, you'd carry forward your development environment and don't set up stuff much

#

as in, I still carry forward my config/dev env that I've set up in 2019 ๐Ÿคทโ€โ™‚๏ธ

unkempt adder
#

I'm trying to test the Tuya changes; I'd ideally like to load my existing connection -- I can manually unpack the tar though

opal hollow
#

it is like scanning a single code to auth it ๐Ÿคทโ€โ™‚๏ธ

unkempt adder
#

It's a little more involved -- copying secrets, access id, username & password -- but fair enough

opal hollow
unkempt adder
#

On the core branch that's what it asked for -- are you thinking about TuyaLocal perhaps?

opal hollow
#

No

#

The Tuya integration has changed a few releases ago

#

and now scans a QR code using your Tuya or SmartLife App

#

secrets, access id, usernames & password have been removed

#

So, no sure what you are working with, but it might possibly well be an outdated branch

unkempt adder
#

๐Ÿคฆ๐Ÿผโ€โ™‚๏ธ I thought I forked the repo for the first time yesterda, but nope -- it's a REALLY old fork

opal hollow
#

hehe stuff happens ๐Ÿ˜„

unkempt adder
#

@opal hollow I noticed with the switch to tuya_shared the API changed from openapi.tuyaus.com to apigw.tuyaus.com and some of the responses are truncated - is there a known workaround?

opal hollow
#

That library is maintained by Tuya

#

If you have questions on their library, you should ask them ๐Ÿ™‚

unkempt adder
#

Sure - I just didn't know if you'd seen anyone else work around it in the components
I think I'm just going to port my changes over to Tuya Local instead ๐Ÿคท