diff options
author | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2021-11-16 20:09:57 +0300 |
---|---|---|
committer | Alexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com> | 2021-11-16 20:09:57 +0300 |
commit | 5518c7918f555fcc1c459f07eba9866a2a6ceb2f (patch) | |
tree | 765d1dc9f5dbe4e673491be595bd399de0affc70 | |
parent | e7dc85732575b76d8fbf8ebdfdb9e57c8db6f4a0 (diff) |
UPDATE_DPS result can be empty and it's ok
-rw-r--r-- | TuyaDevice.cs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/TuyaDevice.cs b/TuyaDevice.cs index 403d93f..deed2a7 100644 --- a/TuyaDevice.cs +++ b/TuyaDevice.cs @@ -296,7 +296,7 @@ namespace com.clusterrr.TuyaNet requestJson = FillJson(requestJson);
var response = await SendAsync(TuyaCommand.UPDATE_DPS, requestJson, retries, nullRetries);
if (string.IsNullOrEmpty(response.JSON))
- throw new InvalidDataException("Response is empty");
+ return new Dictionary<int, object>();
var root = JObject.Parse(response.JSON);
var newDps = JsonConvert.DeserializeObject<Dictionary<string, object>>(root.GetValue("dps").ToString());
return newDps.ToDictionary(kv => int.Parse(kv.Key), kv => kv.Value);
|