Skip to content

Commit 08f0b6b

Browse files
Allow certSign to be 'A' for OEM apps (#13)
Co-authored-by: Max Isom <[email protected]>
1 parent 34b4f65 commit 08f0b6b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ function TuyaCloud(options) {
5858
if (options.apiEtVersion) {
5959
debug('using new API');
6060
if (!options.secret2 || !options.certSign ||
61-
options.secret2.length !== 32 || options.certSign.length !== 95) {
61+
// OEM apps (such as Ledvance and Sylvania) use the single letter "A" instead of a certificate signature.
62+
options.secret2.length !== 32 || (options.certSign.length !== 95 && (options.certSign.length != 1 || options.certSign != 'A'))) {
6263
throw new Error('New API: invalid format for secret2 or certSign');
6364
} else {
6465
this.keyHmac = options.certSign + '_' + options.secret2 + '_' + options.secret;

0 commit comments

Comments
 (0)