-
Couldn't load subscription status.
- Fork 9
Extended iot-device table with chirpstack fields #230
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extended iot-device table with chirpstack fields #230
Conversation
…datatarget-id-to-error-message
…e/IOT-1380-update-gateway-eui-input
…/IOT-1486-add-error-message-to-email-in-use
…if no user admins found
Added job to populate empty fields Added support for new sorting options
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments
| export class LorawanDeviceDatabaseEnrichJob { | ||
| constructor(private chirpstackDeviceService: ChirpstackDeviceService, private iotDeviceService: IoTDeviceService) {} | ||
|
|
||
| @Cron(CronExpression.EVERY_DAY_AT_5AM) // TODO: Finalize when to run |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is very cool! So we just need to figure out when to make this enrichment? Or is it already decided (should the todo be removed)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It should be changed to a timeoutJob, this is probably better done it a fresh branch due to incoming changes in the gateway PR #231
| // OTAA | ||
| loraDevice.lorawanSettings.activationType = ActivationType.OTAA; | ||
| loraDevice.lorawanSettings.OTAAapplicationKey = keys.nwkKey; | ||
| loraDevice.OTAAapplicationKey = keys.nwkKey; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do this when we have the otaaapplicationkey on the lorawansettings? :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lorawan settings are not set in the database prior to this, and if the device is not otaa it should not be set
| const deviceProfile = await this.deviceProfileService.findOneDeviceProfileById( | ||
| dto.lorawanSettings.deviceProfileID | ||
| ); | ||
| lorawanDevice.deviceProfileName = deviceProfile.deviceProfile.name; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Question: Would it be better to include the deviceProfileName in the dto instead of calling chirpstack for getting the name? :-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say no personally, this way the name till be updated to the actual time of creation (VERY edge case of profile name being changed while you're creating the device prevented by this)
Added job to populate empty fields
Added support for new sorting options