jasonacox / tinytuya

Python API for Tuya WiFi smart devices using a direct local area network (LAN) connection or the cloud (TuyaCloud API).
MIT License
879 stars 159 forks source link

Bash Install for customers, Cool it finally Works! #358

Open sjpbailey opened 1 year ago

sjpbailey commented 1 year ago

Hello Jason,

I have finally just finished the first version of a Node Server for Universal Devices using TinyTuya! I was amazed at how much work you all have put into this! Fantastic stuff from when i first polled devices.

Now on my development machine i ran the bash command for a scan and had all the devices up:

LED Garage   Product ID = keypcvqhw97kqy4h  [Valid Broadcast]:
    Address = 192.168.1.148   Device ID = ebfd4f4263bb769d99zjkq (len:22)  Local Key = ec0b2b581a246eab  Version = 3.3  Type = default, MAC = 84:e3:42:1a:94:31
    Status: {'20': False, '21': 'white', '22': 10, '23': 1000, '24': '015403a003e0', '25': '000d0d0000000000000000180000', '26': 0}
LED Strip Cabinets   Product ID = keys8pj5xkq8cmrm  [Valid Broadcast]:

Now within my Home Automation Node Server code i used "tinytuya.deviceScan(False, 20)" and bang after a minute all of the devices (TreatLife LED Switches) with the new json format. New from what i was using! Everything is great and all of my devices come up and work in my home automation console, beat my chest, Raaaa lol!.

Well then I ran Bash command again "python -m tinytuya scan" and failed it, On Purpose! Then i polled devices and they all came up in RED, not communicating. Try to Re-installed the Node Server i wrote and it fails. Had no json data 'dps' data, well no data except bits of json really.

My code doesn't work, WHAT, Panic lol!!! Wooo Cowboy try to be smart, It Did Work!

All Good!

Restarted computer run Bash again and bang all of them started to communicate and are Green!

Re-install my Automation Node Server and bang everyone polls again! YEAH!

Question: Can you possibly make an executable for 'python -m tinytuya scan' a customer without Python can run?

This is something I didn't see that was right in front of me! Feel dumb daily hehe! Especially after you told me to clean my old installs last time! I would write Python code it all works then Bang it doesn't. So what do I do, edit code for a year trying to solve it! DOH!!!

I am going to install my work on UDI's beta store that will run on their front end for Beta testing soon.

Highest Regards, Enjoy Your Day.

jasonacox commented 1 year ago

Thanks @sjpbailey !

Can you possibly make an executable for 'python -m tinytuya scan' a customer without Python can run?

Python is an interpreted programming language, meaning that the code written in Python needs to be interpreted by a Python interpreter in order for it to run. This also allows it to run across a variety of operating systems (Linux, Windows, MacOS) without changing the code.