|
2 | 2 | using System.Collections.Generic; |
3 | 3 | using System.Dynamic; |
4 | 4 | using System.IO; |
| 5 | +using System.Linq; |
5 | 6 | using Newtonsoft.Json; |
6 | 7 | using static ZWaveJS.NET.Enums; |
7 | 8 |
|
@@ -168,45 +169,45 @@ public class SmartStartProvisioningEntry |
168 | 169 | { |
169 | 170 | internal SmartStartProvisioningEntry() { } |
170 | 171 |
|
171 | | - public SmartStartProvisioningEntry(string dsk, SecurityClass[] securityClasses, Protocols protocol = Protocols.ZWave) |
| 172 | + public SmartStartProvisioningEntry(QRProvisioningInformation ProvisioningInformation, Protocols protocol = Protocols.ZWave, ProvisioningEntryStatus status = ProvisioningEntryStatus.Active) |
| 173 | + { |
| 174 | + if(!ProvisioningInformation.supportedProtocols.Contains(protocol)) |
| 175 | + { |
| 176 | + throw new NotSupportedException("The provided protocol is not supported by this device."); |
| 177 | + } |
| 178 | + |
| 179 | + this.dsk = ProvisioningInformation.dsk; |
| 180 | + this.securityClasses = ProvisioningInformation.securityClasses; |
| 181 | + this.requestedSecurityClasses = ProvisioningInformation.securityClasses; |
| 182 | + this.supportedProtocols = ProvisioningInformation.supportedProtocols; |
| 183 | + this.protocol = protocol; |
| 184 | + this.status = status; |
| 185 | + } |
| 186 | + |
| 187 | + public SmartStartProvisioningEntry(string dsk, SecurityClass[] securityClasses, Protocols protocol = Protocols.ZWave, ProvisioningEntryStatus status = ProvisioningEntryStatus.Active) |
172 | 188 | { |
173 | 189 | this.dsk = dsk; |
174 | 190 | this.securityClasses = securityClasses; |
175 | 191 | this.requestedSecurityClasses = securityClasses; |
176 | 192 | this.protocol = protocol; |
| 193 | + this.status = status; |
177 | 194 | this.supportedProtocols = new Protocols[1] { protocol }; |
178 | 195 | } |
179 | 196 |
|
180 | 197 | [Newtonsoft.Json.JsonProperty] |
181 | | - public ProvisioningEntryStatus status { get; internal set; } |
| 198 | + public ProvisioningEntryStatus? status { get; internal set; } |
182 | 199 | [Newtonsoft.Json.JsonProperty] |
183 | 200 | public string dsk { get; internal set; } |
184 | 201 | [Newtonsoft.Json.JsonProperty] |
185 | 202 | public Protocols? protocol { get; internal set; } |
186 | 203 | [Newtonsoft.Json.JsonProperty] |
187 | 204 | public Protocols[] supportedProtocols { get; internal set; } |
188 | 205 | [Newtonsoft.Json.JsonProperty] |
189 | | - public SecurityClass[] securityClasses { get; internal set; } |
| 206 | + public SecurityClass[] securityClasses { get; set; } |
190 | 207 | [Newtonsoft.Json.JsonProperty] |
191 | 208 | public SecurityClass[] requestedSecurityClasses { get; internal set; } |
192 | 209 | [Newtonsoft.Json.JsonProperty] |
193 | | - public int version { get; internal set; } |
194 | | - [Newtonsoft.Json.JsonProperty] |
195 | | - public int genericDeviceClass { get; internal set; } |
196 | | - [Newtonsoft.Json.JsonProperty] |
197 | | - public int specificDeviceClass { get; internal set; } |
198 | | - [Newtonsoft.Json.JsonProperty] |
199 | | - public int installerIconType { get; internal set; } |
200 | | - [Newtonsoft.Json.JsonProperty] |
201 | | - public int manufacturerId { get; internal set; } |
202 | | - [Newtonsoft.Json.JsonProperty] |
203 | | - public int productType { get; internal set; } |
204 | | - [Newtonsoft.Json.JsonProperty] |
205 | | - public int productId { get; internal set; } |
206 | | - [Newtonsoft.Json.JsonProperty] |
207 | | - public decimal applicationVersion { get; internal set; } |
208 | | - [Newtonsoft.Json.JsonProperty] |
209 | | - public int nodeId { get; internal set; } |
| 210 | + public int? nodeId { get; internal set; } |
210 | 211 | } |
211 | 212 |
|
212 | 213 | public class RebuildRoutesOptions |
|
0 commit comments