-
Notifications
You must be signed in to change notification settings - Fork 111
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
APP-7497: Add Switch client, server, and fake models #4741
Conversation
components/switch/client.go
Outdated
@@ -0,0 +1,88 @@ | |||
// Package switch_component contains a gRPC based switch client. | |||
package switch_component |
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.
Note: switch
is a keyword, so the package is called switch_component
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.
le sigh
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.
toggleswitch
?
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.
Doesn't matter to me, happy to update to toggleswitch
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.
lets do it
904d410
to
9038c5c
Compare
d1ec868
to
d62aae2
Compare
9038c5c
to
fc28a0f
Compare
components/switch/client.go
Outdated
@@ -0,0 +1,88 @@ | |||
// Package switch_component contains a gRPC based switch client. | |||
package switch_component |
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.
le sigh
Done with first pass - will look at tests in the second. |
4996b8f
to
f31815d
Compare
resp, err := client1.DoCommand(context.Background(), testutils.TestCommand) | ||
test.That(t, err, test.ShouldBeNil) | ||
test.That(t, resp["command"], test.ShouldEqual, testutils.TestCommand["command"]) | ||
test.That(t, resp["data"], test.ShouldEqual, testutils.TestCommand["data"]) |
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.
@randhid any thoughts on why this DoCommand client test would be failing? I've spent a good amount of time debugging and I can't figure it out. For whatever reason, the inject button implementation of DoCommand is not being called.
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.
There is no server DoCommand implemented for switch https://github.com/viamrobotics/rdk/pull/4741/files#r1933063119
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.
Ah, thank you for catching this!!
components/switch/switch_test.go
Outdated
@@ -0,0 +1,37 @@ | |||
package toggleswitch_test |
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.
move this to fake switch's folder.
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.
d52ab1b
to
1ff98bc
Compare
f31815d
to
5e27be1
Compare
5e27be1
to
60f8380
Compare
This adds the switch client and server, and registers switch 2-way, 3-way, and 10-way fake models.
Here are switch components properly configured in app:
Change log
I used Cursor quite a bit here:
Switch
SDK helpersReview requests