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

Fix #1331 : In scene, add OR condition to check-time action #1425

Merged
merged 3 commits into from
Feb 1, 2022

Conversation

Pierre-Gilles
Copy link
Contributor

@Pierre-Gilles Pierre-Gilles commented Jan 31, 2022

Pull Request check-list

To ensure your Pull Request can be accepted as fast as possible, make sure to review and check all of these items:

  • If your changes affects code, did your write the tests?
  • Are tests passing? (npm test on both front/server)
  • Is the linter passing? (npm run eslint on both front/server)
  • Did you run prettier? (npm run prettier on both front/server)
  • If you are adding a new features/services, did you run integration comparator? (npm run compare-translations on front)
  • Did you test this pull request in real life? With real devices? If this development is a big feature or a new service, we recommend that you provide a Docker image to the community for testing before merging.
  • If your changes modify the API (REST or Node.js), did you modify the API documentation? (Documentation is based on comments in code)
  • If you are adding a new features/services which needs explanation, did you modify the user documentation? See the GitHub repo and the website.
  • Did you add fake requests data for the demo mode (front/src/config/demo.js) so that the demo website is working without a backend? (if needed) See https://demo.gladysassistant.com.

NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.

Description of change

This let the user use conditional time check when after time is before the before time.

@relativeci
Copy link

relativeci bot commented Jan 31, 2022

Job #180: Bundle Size — 6.67MB (0%).

cfee2ac vs f499d43

No changes


View Job #180 report on app.relative-ci.com

@codecov
Copy link

codecov bot commented Jan 31, 2022

Codecov Report

Merging #1425 (8eaef80) into master (f499d43) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1425   +/-   ##
=======================================
  Coverage   96.54%   96.54%           
=======================================
  Files         613      613           
  Lines        8738     8747    +9     
=======================================
+ Hits         8436     8445    +9     
  Misses        302      302           
Impacted Files Coverage Δ
server/lib/scene/scene.actions.js 97.72% <100.00%> (+0.16%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f499d43...8eaef80. Read the comment docs.

@Pierre-Gilles Pierre-Gilles changed the title In scene, add OR condition to check-time action Fix #1331 : In scene, add OR condition to check-time action Jan 31, 2022
Copy link
Contributor

@cicoub13 cicoub13 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code is OK (thanks for the Boy Scout rule application on tests 😉 )

Tested locally with some functional cases => OK for me

2022-01-31T13:54:37+0100 <debug> scene.actions.js:161 (Object.condition.check-time) Check time before: 13:54 < 09:10 condition is not verified.
2022-01-31T13:54:37+0100 <debug> scene.actions.js:176 (Object.condition.check-time) Check time after: 13:54 > 13:35 condition is valid.
2022-01-31T13:54:37+0100 <debug> scene.actions.js:192 (Object.condition.check-time) Check time: Condition OR verified.

@Pierre-Gilles
Copy link
Contributor Author

Thanks for the review @cicoub13 ! 🙏 What's the "Boy Scout rule application on tests" ? 😂

@cicoub13
Copy link
Contributor

cicoub13 commented Jan 31, 2022

Boy Scout Rule in IT = "Always leave the code better than you found it"

You used this fix opportunity to move test code in dedicated file 💪

https://biratkirat.medium.com/step-8-the-boy-scout-rule-robert-c-martin-uncle-bob-9ac839778385

@Pierre-Gilles
Copy link
Contributor Author

Oh yes indeed 👍

Copy link
Contributor

@atrovato atrovato left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code is good enough to me, I didn't test it in real life, I suppose others will ;)

scope,
);
} catch (e) {
console.log(e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unexpected console statement!

@Pierre-Gilles Pierre-Gilles merged commit cfee2ac into master Feb 1, 2022
@Pierre-Gilles Pierre-Gilles deleted the add-or-condition-check-time-scene branch February 1, 2022 10:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants