Skip to content

Commit

Permalink
fix(proto): add device ID
Browse files Browse the repository at this point in the history
  • Loading branch information
coderbyheart committed Apr 25, 2023
1 parent 8278503 commit 0b99772
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions nrfGuide/NRFGuideMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,6 +286,11 @@ const AirHumidity = Type.Object({

export const DeviceIdentity = Type.Object({
'@context': Type.Literal(Context.deviceIdentity.toString()),
id: Type.String({
minLength: 1,
description: 'the device ID',
examples: ['nrf-352656108602296'],
}),
model: Type.String({
minLength: 1,
description: 'the device model',
Expand Down
1 change: 1 addition & 0 deletions nrfGuide/proto.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ describe('nRF Guide messages', () => {
it('should validate a device identity message', () => {
const deviceIdentityMessage: Static<typeof DeviceIdentity> = {
'@context': 'https://github.com/bifravst/nRF-Guide-proto/deviceIdentity',
id: 'nrf-352656108602296',
model: 'PCA20035+solar',
}
expect(validPassthrough(deviceIdentityMessage)).toMatchObject(
Expand Down

0 comments on commit 0b99772

Please sign in to comment.