Skip to content

Commit

Permalink
Add name to merged movement sensor in creator (viamrobotics#2625)
Browse files Browse the repository at this point in the history
  • Loading branch information
randhid authored Jul 11, 2023
1 parent f002b4a commit c6b58f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions components/movementsensor/merged/merged.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func newMergedModel(ctx context.Context, deps resource.Dependencies, conf resour
) {
m := merged{
logger: logger,
Named: conf.ResourceName().AsNamed(),
}

if err := m.Reconfigure(ctx, deps, conf); err != nil {
Expand Down
3 changes: 3 additions & 0 deletions components/movementsensor/merged/merged_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,9 @@ func TestCreation(t *testing.T) {
err = ms.Reconfigure(ctx, deps, conf)
test.That(t, err, test.ShouldBeNil)

res := ms.Name()
test.That(t, res, test.ShouldNotBeNil)

pos, alt, err = ms.Position(ctx, nil)
test.That(t, err, test.ShouldBeNil)
test.That(t, pos, test.ShouldEqual, testgeopoint)
Expand Down

0 comments on commit c6b58f4

Please sign in to comment.