fix: process GPN response in DiscoveringParametersState
The GPN response (ParameterInfoStruct list) was received but never
processed — organizeParameters() was never called, so discovered
parameters were lost and gpnStatus was never set to 'supported'.
Now on each successful GPN response:
- device.organizeParameters() is called to store leaf params/props
- device.setGpnStatus('supported') marks the device as GPN-capable
This fixes: parameters not showing in UI, wrong dataModel detection,
and PeriodicInformInterval not appearing after SPV.
Generated with [Continue](https://continue.dev)
Co-Authored-By: Continue <noreply@continue.dev>
This commit is contained in:
1 parent
4a035dbc67
commit
7540327689
1 file changed
+15
-1
@@ -130,7 +130,21 @@ class DiscoveringParametersState extends DeviceState {
|
||||
return { nextState: new CriticalReadsState(), response: '' }
|
||||
}
|
||||
|
||||
// Process response and continue
|
||||
// GPN success — process the response
|
||||
if (context.message?.success && context.message.data) {
|
||||
try {
|
||||
context.device.organizeParameters(context.message.data, new Date())
|
||||
context.device.setGpnStatus('supported')
|
||||
logger.info(
|
||||
{ deviceId: context.device.identifier, paramCount: context.device.getParameters().length },
|
||||
'[DiscoveringParameters] GPN response processed'
|
||||
)
|
||||
} catch (e: any) {
|
||||
logger.error({ error: e?.message }, '[DiscoveringParameters] Error processing GPN response')
|
||||
}
|
||||
}
|
||||
|
||||
// Continue with next path in queue if any
|
||||
if (this.parameterQueue.length > 0) {
|
||||
return { response: await this.processNext(context) }
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user