Skip to content

Commit

Permalink
dr: Update end device model fields in provisioning info
Browse files Browse the repository at this point in the history
  • Loading branch information
Vlad Vitan committed Aug 13, 2024
1 parent cdd001d commit bb127ec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 52 deletions.
9 changes: 5 additions & 4 deletions pkg/devicerepository/store/remote/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,12 @@ func (s *remoteStore) GetProvisioningInfo(req store.GetProvisioningInfoRequest)
BrandID: brandID,
ModelID: vendorProfile.EndDeviceId,
Paths: []string{
"brand_id",
"model_id",
"name",
"firmware_versions",
"hardware_versions",
"description",
"key_provisioning",
"photos",
"product_url",
"datasheet_url",
},
})
if err != nil {
Expand Down
54 changes: 6 additions & 48 deletions pkg/devicerepository/store/remote/remote_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,54 +46,12 @@ func TestRemoteStore(t *testing.T) {
a.So(provisioningInfo, should.Resemble, &store.GetProvisioningInfoResponse{
ProvisioningInfo: &ttnpb.EndDeviceProvisioningInfo{
EndDeviceModel: &ttnpb.EndDeviceModel{
BrandId: "repo-example",
ModelId: "windsensor",
Name: "Wind Sensor",
HardwareVersions: []*ttnpb.EndDeviceModel_HardwareVersion{
{Version: "1.0", Numeric: 1},
{Version: "1.0-rev-A", Numeric: 2},
},
FirmwareVersions: []*ttnpb.EndDeviceModel_FirmwareVersion{
{
Version: "1.0",
Numeric: 1,
SupportedHardwareVersions: []string{"1.0"},
Profiles: map[string]*ttnpb.EndDeviceModel_FirmwareVersion_Profile{
"EU_863_870": {
VendorId: "repo-example",
ProfileId: "windsensor-profile",
LorawanCertified: true,
CodecId: "windsensor-codec",
},
"US_902_928": {
ProfileId: "windsensor-profile",
LorawanCertified: true,
CodecId: "windsensor-codec",
},
},
},
{
Version: "2.0",
Numeric: 2,
SupportedHardwareVersions: []string{"1.0-rev-A"},
Profiles: map[string]*ttnpb.EndDeviceModel_FirmwareVersion_Profile{
"EU_863_870": {
ProfileId: "windsensor-profile",
LorawanCertified: true,
CodecId: "windsensor-codec",
},
"US_902_928": {
ProfileId: "windsensor-profile",
LorawanCertified: true,
CodecId: "windsensor-codec",
},
"AS_923": {
ProfileId: "windsensor-profile",
CodecId: "windsensor-codec",
},
},
},
},
Name: "Wind Sensor",
Description: "Wind Sensor with controllable LED",
DatasheetUrl: "https://example.org/wind-sensor/datasheet.pdf",
KeyProvisioning: []ttnpb.KeyProvisioning{ttnpb.KeyProvisioning_KEY_PROVISIONING_CUSTOM, ttnpb.KeyProvisioning_KEY_PROVISIONING_JOIN_SERVER},
Photos: &ttnpb.EndDeviceModel_Photos{Main: "windsensor.png", Other: []string{"windsensor-package.png"}},
ProductUrl: "https://example.org/wind-sensor",
},
EndDeviceTemplate: &ttnpb.EndDeviceTemplate{
EndDevice: &ttnpb.EndDevice{
Expand Down

0 comments on commit bb127ec

Please sign in to comment.