Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/ClusterM/tuyanet.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2021-12-20 11:51:50 +0300
committerAlexey 'Cluster' Avdyukhin <clusterrr@clusterrr.com>2021-12-20 11:51:50 +0300
commit415433c5863bf051a00a39f31996652b79da679f (patch)
tree2442079d37ca9de22027f998e4dd3a86cbd1eee6
parent6445a6a2cb97aacd95be76d5687881aabea97feb (diff)
Exception handling fix
-rw-r--r--TuyaDevice.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/TuyaDevice.cs b/TuyaDevice.cs
index 41331e6..633f1b0 100644
--- a/TuyaDevice.cs
+++ b/TuyaDevice.cs
@@ -119,7 +119,7 @@ namespace com.clusterrr.TuyaNet
/// <returns>Raw data.</returns>
public byte[] EncodeRequest(TuyaCommand command, string json)
{
- if (string.IsNullOrEmpty(accessId)) throw new ArgumentException("LocalKey is not specified", "LocalKey");
+ if (string.IsNullOrEmpty(LocalKey)) throw new ArgumentException("LocalKey is not specified", "LocalKey");
return TuyaParser.EncodeRequest(command, json, Encoding.UTF8.GetBytes(LocalKey), ProtocolVersion);
}
@@ -130,7 +130,7 @@ namespace com.clusterrr.TuyaNet
/// <returns>Instance of TuyaLocalResponse.</returns>
public TuyaLocalResponse DecodeResponse(byte[] data)
{
- if (string.IsNullOrEmpty(accessId)) throw new ArgumentException("LocalKey is not specified", "LocalKey");
+ if (string.IsNullOrEmpty(LocalKey)) throw new ArgumentException("LocalKey is not specified", "LocalKey");
return TuyaParser.DecodeResponse(data, Encoding.UTF8.GetBytes(LocalKey), ProtocolVersion);
}