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

improve sendcommand #303

Merged
merged 1 commit into from
Mar 20, 2023
Merged

improve sendcommand #303

merged 1 commit into from
Mar 20, 2023

Conversation

Syrooo
Copy link
Contributor

@Syrooo Syrooo commented Mar 18, 2023

Hello, I have an infrared tuya device. I tryied to control my TV with tinytuya, it did not work (smart life app is working ofc). So I look into https://iot.tuya.com/cloud/ > my app > devices > debug device > device debugging and look the API commands send by the javascript .

All of that for this little change with URI=iot-03/devices/DEVID/commands if does not work, with URI=devices/DEVID/commands it works.

I hope it will help some other persons.

@Syrooo
Copy link
Contributor Author

Syrooo commented Mar 18, 2023

A exemple of my local test:

from tinytuya import *

# Connect to Tuya Cloud
c = Cloud(
        apiRegion="eu", 
        apiKey="KEY", 
        apiSecret="SECRET")

# Select a Device ID to Test
id = "DEVID" #tv


# Send Command - Turn on switch
commands = {
	'commands': [
  {
    "code": "Volume-"
  }
]
}

print("Sending command...")
result = c.sendcommand(id,commands,uri='devices/')
print("Results\n:", result)

@jasonacox jasonacox merged commit 540d1f5 into jasonacox:master Mar 20, 2023
@jasonacox
Copy link
Owner

Thanks for this @Syrooo ! Nice addition.

@Syrooo
Copy link
Contributor Author

Syrooo commented Mar 20, 2023

Thanks for this @Syrooo ! Nice addition.

You are welcome

@jasonacox
Copy link
Owner

jasonacox commented Mar 23, 2023

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.

2 participants