Skip to content

Conversation

@marcus-j-davies
Copy link
Member

No description provided.

@marcus-j-davies
Copy link
Member Author

marcus-j-davies commented Jun 26, 2024

@spudwebb

After some input from @AlCalzone, this PR reps the following.

ProvisionSmartStartNode now only accepts a SmartStartProvisioningEntry this is pretty much a Planned Provisioning Entry in the JS runtime

SmartStartProvisioningEntry can be created in 2 ways.

/* Your last PR - I added a default status */ 

public SmartStartProvisioningEntry(string dsk, SecurityClass[] securityClasses, Protocols protocol = Protocols.ZWave, ProvisioningEntryStatus status = ProvisioningEntryStatus.Active)
{
   this.dsk = dsk;
   this.securityClasses = securityClasses;
   this.requestedSecurityClasses = securityClasses;
   this.protocol = protocol;
   this.status = status;
   this.supportedProtocols = new Protocols[1] { protocol };
}
/* From a Parsed QR */

public SmartStartProvisioningEntry(QRProvisioningInformation ProvisioningInformation, Protocols protocol = Protocols.ZWave, ProvisioningEntryStatus status = ProvisioningEntryStatus.Active)
{
   if(!ProvisioningInformation.supportedProtocols.Contains(protocol))
   {
         throw new NotSupportedException("The provided protocol is not supported by this device.");
   }
           
   this.dsk = ProvisioningInformation.dsk;
   this.securityClasses = ProvisioningInformation.securityClasses;
   this.requestedSecurityClasses = ProvisioningInformation.securityClasses;
   this.supportedProtocols = ProvisioningInformation.supportedProtocols;
   this.protocol = protocol;
   this.status = status;
}

The securityClasses property of a SmartStartProvisioningEntry can be modified after creation, to allow Users to set what security classes they want to allow, after a QR code has been scanned for example

QRProvisioningInformation can be fetched by passing the QR Code Data to the Utils.ParseQRCodeString method

GetProvisioningEntries will return SmartStartProvisioningEntry[] with the additional nodeId if currently included

@AlCalzone, I believe this should fall more in line with what ProvisionSmartStartNode wants?

References:

public class QRProvisioningInformation

public class SmartStartProvisioningEntry

@AlCalzone
Copy link
Member

AlCalzone commented Jun 27, 2024

I believe this should fall more in line with what ProvisionSmartStartNode wants?

The QR code can also contain additional info, like manufacturer and label. While it is not required to provision a node, it would still be good to copy all additional properties (that have a value) from QRProvisioningInformation to the PlannedProvisioningEntry, so they get persisted in the cache.
Z-Wave JS UI for example shows them if they exist.

@marcus-j-davies
Copy link
Member Author

Right!

I do that anyway, in NR - Thanks

@marcus-j-davies marcus-j-davies merged commit d62a6dd into 4.0.0 Jan 26, 2025
1 check passed
@marcus-j-davies marcus-j-davies deleted the fix-up-smart-start branch January 26, 2025 11:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants