Skip to content
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

Implementing new scenarios: wait-pin and wait-pin-change #11

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
formating code
  • Loading branch information
rafaelcorsi committed Feb 2, 2024
commit d0d1ef8508139f7e7ade25a54d68e7ecd8ee0b79
4 changes: 0 additions & 4 deletions src/scenario/WaitPinChangeCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,10 @@ export class WaitPinChangeCommand implements IScenarioCommand {
const partId = params['part-id'];
const pinName = params.pin;
const initalValue = (await client.pinRead(partId, pinName))?.value ? 1 : 0;

scenario.log(
chalkTemplate`wait-pin-toggle {yellow ${partId}}:{magenta ${pinName}} to change from {yellow ${initalValue}}`,
);


let value = (await client.pinRead(partId, pinName))?.value ? 1 : 0;

while (value == initalValue) {
value = (await client.pinRead(partId, pinName))?.value ? 1 : 0;
}
Expand Down
1 change: 0 additions & 1 deletion src/scenario/WaitPinCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ export class WaitPinCommand implements IScenarioCommand {
chalkTemplate`wait-pin {yellow ${partId}}:{magenta ${pinName}} == {yellow ${expectedValue}}`,
);
let value = (await client.pinRead(partId, pinName))?.value ? 1 : 0;

while (value !== expectedValue) {
value = (await client.pinRead(partId, pinName))?.value ? 1 : 0;
}
Expand Down