Mathieu2301 / Tuya-Cloud-API

API For Tuya Cloud
4 stars 1 forks source link

Allow choosing other regions #1

Closed tehshane closed 3 years ago

tehshane commented 3 years ago

https://github.com/Mathieu2301/Tuya-Cloud-API/blob/282f2c2d350d6d45aaefde312f8932e76ae85312/main.js#L8

Currently, the library appears to be hard-coded to the EU datacenter for Tuya Cloud.

Perhaps add an option to the constructor to allow choosing other datacenters like China or North America?

Thanks for a great library!

Mathieu2301 commented 3 years ago

Hello ! I added this option to choose the Tuya server

tuyaCloud.connect({
  region: 'xx', // eu / us / cn / in
  clientID: 'xxxxxxxxxxxxxxxxxxxx',
  secret: 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx',
});

Thank you ! 🙂

tehshane commented 3 years ago

That's awesome, thank you so much! 🎉