mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 13:54:53 +00:00
Add TUYA_EU_URL to Tuya configuration
This commit is contained in:
@ -5,6 +5,7 @@ export default registerAs(
|
|||||||
(): Record<string, any> => ({
|
(): Record<string, any> => ({
|
||||||
TUYA_ACCESS_ID: process.env.TUYA_ACCESS_ID,
|
TUYA_ACCESS_ID: process.env.TUYA_ACCESS_ID,
|
||||||
TUYA_ACCESS_KEY: process.env.TUYA_ACCESS_KEY,
|
TUYA_ACCESS_KEY: process.env.TUYA_ACCESS_KEY,
|
||||||
|
TUYA_EU_URL: process.env.TUYA_EU_URL,
|
||||||
TRUN_ON_TUYA_SOCKET:
|
TRUN_ON_TUYA_SOCKET:
|
||||||
process.env.TRUN_ON_TUYA_SOCKET === 'true' ? true : false,
|
process.env.TRUN_ON_TUYA_SOCKET === 'true' ? true : false,
|
||||||
}),
|
}),
|
||||||
|
|||||||
@ -35,8 +35,9 @@ export class DeviceService {
|
|||||||
) {
|
) {
|
||||||
const accessKey = this.configService.get<string>('auth-config.ACCESS_KEY');
|
const accessKey = this.configService.get<string>('auth-config.ACCESS_KEY');
|
||||||
const secretKey = this.configService.get<string>('auth-config.SECRET_KEY');
|
const secretKey = this.configService.get<string>('auth-config.SECRET_KEY');
|
||||||
|
const tuyaEuUrl = this.configService.get<string>('tuya-config.TUYA_EU_URL');
|
||||||
this.tuya = new TuyaContext({
|
this.tuya = new TuyaContext({
|
||||||
baseUrl: 'https://openapi.tuyaeu.com',
|
baseUrl: tuyaEuUrl,
|
||||||
accessKey,
|
accessKey,
|
||||||
secretKey,
|
secretKey,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -18,8 +18,9 @@ export class GroupService {
|
|||||||
) {
|
) {
|
||||||
const accessKey = this.configService.get<string>('auth-config.ACCESS_KEY');
|
const accessKey = this.configService.get<string>('auth-config.ACCESS_KEY');
|
||||||
const secretKey = this.configService.get<string>('auth-config.SECRET_KEY');
|
const secretKey = this.configService.get<string>('auth-config.SECRET_KEY');
|
||||||
|
const tuyaEuUrl = this.configService.get<string>('tuya-config.TUYA_EU_URL');
|
||||||
this.tuya = new TuyaContext({
|
this.tuya = new TuyaContext({
|
||||||
baseUrl: 'https://openapi.tuyaeu.com',
|
baseUrl: tuyaEuUrl,
|
||||||
accessKey,
|
accessKey,
|
||||||
secretKey,
|
secretKey,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -21,8 +21,9 @@ export class CheckDeviceGuard implements CanActivate {
|
|||||||
) {
|
) {
|
||||||
const accessKey = this.configService.get<string>('auth-config.ACCESS_KEY');
|
const accessKey = this.configService.get<string>('auth-config.ACCESS_KEY');
|
||||||
const secretKey = this.configService.get<string>('auth-config.SECRET_KEY');
|
const secretKey = this.configService.get<string>('auth-config.SECRET_KEY');
|
||||||
|
const tuyaEuUrl = this.configService.get<string>('tuya-config.TUYA_EU_URL');
|
||||||
this.tuya = new TuyaContext({
|
this.tuya = new TuyaContext({
|
||||||
baseUrl: 'https://openapi.tuyaeu.com',
|
baseUrl: tuyaEuUrl,
|
||||||
accessKey,
|
accessKey,
|
||||||
secretKey,
|
secretKey,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -28,8 +28,9 @@ export class SceneService {
|
|||||||
) {
|
) {
|
||||||
const accessKey = this.configService.get<string>('auth-config.ACCESS_KEY');
|
const accessKey = this.configService.get<string>('auth-config.ACCESS_KEY');
|
||||||
const secretKey = this.configService.get<string>('auth-config.SECRET_KEY');
|
const secretKey = this.configService.get<string>('auth-config.SECRET_KEY');
|
||||||
|
const tuyaEuUrl = this.configService.get<string>('tuya-config.TUYA_EU_URL');
|
||||||
this.tuya = new TuyaContext({
|
this.tuya = new TuyaContext({
|
||||||
baseUrl: 'https://openapi.tuyaeu.com',
|
baseUrl: tuyaEuUrl,
|
||||||
accessKey,
|
accessKey,
|
||||||
secretKey,
|
secretKey,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -37,8 +37,10 @@ export class UnitService {
|
|||||||
) {
|
) {
|
||||||
const accessKey = this.configService.get<string>('auth-config.ACCESS_KEY');
|
const accessKey = this.configService.get<string>('auth-config.ACCESS_KEY');
|
||||||
const secretKey = this.configService.get<string>('auth-config.SECRET_KEY');
|
const secretKey = this.configService.get<string>('auth-config.SECRET_KEY');
|
||||||
|
const tuyaEuUrl = this.configService.get<string>('tuya-config.TUYA_EU_URL');
|
||||||
|
|
||||||
this.tuya = new TuyaContext({
|
this.tuya = new TuyaContext({
|
||||||
baseUrl: 'https://openapi.tuyaeu.com',
|
baseUrl: tuyaEuUrl,
|
||||||
accessKey,
|
accessKey,
|
||||||
secretKey,
|
secretKey,
|
||||||
});
|
});
|
||||||
|
|||||||
@ -9,9 +9,9 @@ export class UserService {
|
|||||||
constructor(private readonly configService: ConfigService) {
|
constructor(private readonly configService: ConfigService) {
|
||||||
const accessKey = this.configService.get<string>('auth-config.ACCESS_KEY');
|
const accessKey = this.configService.get<string>('auth-config.ACCESS_KEY');
|
||||||
const secretKey = this.configService.get<string>('auth-config.SECRET_KEY');
|
const secretKey = this.configService.get<string>('auth-config.SECRET_KEY');
|
||||||
// const clientId = this.configService.get<string>('auth-config.CLIENT_ID');
|
const tuyaEuUrl = this.configService.get<string>('tuya-config.TUYA_EU_URL');
|
||||||
this.tuya = new TuyaContext({
|
this.tuya = new TuyaContext({
|
||||||
baseUrl: 'https://openapi.tuyaeu.com',
|
baseUrl: tuyaEuUrl,
|
||||||
accessKey,
|
accessKey,
|
||||||
secretKey,
|
secretKey,
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user