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

Use device feature for scene action of type turn on/off light/switch #1768

Closed
wants to merge 29 commits into from

Conversation

rpochet
Copy link
Contributor

@rpochet rpochet commented May 1, 2023

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)
  • [x ] Is the linter passing? (npm run eslint on both front/server)
  • [ x] 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)
  • [ x] 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

In scene, provide selection of device feature instance of device in 'Turn ON/OFF light/switch' actions.

image

Before:
image

New proposal:
image

@rpochet rpochet changed the title Initial commit Use device feature for scene action of type turn on/off light/switch May 2, 2023
@codecov
Copy link

codecov bot commented May 3, 2023

Codecov Report

All modified lines are covered by tests ✅

Files Coverage Δ
server/lib/scene/scene.actions.js 97.39% <100.00%> (-1.00%) ⬇️

... and 30 files with indirect coverage changes

📢 Thoughts on this report? Let us know!.

Copy link
Contributor

@Pierre-Gilles Pierre-Gilles left a comment

Choose a reason for hiding this comment

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

Thanks for the PR, it works fine on my side ! great work 👏

You need to write a DB migration to update all existing scenes, otherwise all the scene already working will stop working for existing Gladys users.

I wrote other feedbacks in the code.

server/lib/scene/scene.actions.js Show resolved Hide resolved
@rpochet
Copy link
Contributor Author

rpochet commented May 5, 2023

You need to write a DB migration to update all existing scenes, otherwise all the scene already working will stop working for existing Gladys users.

How can I test DB migration?

@Pierre-Gilles
Copy link
Contributor

@rpochet Currently we don't have any ways to unit test data migration

I bet you could write a unit test importing a migration file and then calling the up function if you want to ? :)

@stale
Copy link

stale bot commented Aug 16, 2023

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Aug 16, 2023
@stale stale bot removed the stale label Aug 16, 2023
@relativeci
Copy link

relativeci bot commented Sep 12, 2023

Job #1907: Bundle Size — 8.82MiB (~+0.01%).

7ba4b26(current) vs 04f331d master#1902(baseline)

Warning

Bundle contains 3 duplicate packages – View duplicate packages

Bundle metrics  Change 2 changes Regression 1 regression
                 Current
Job #1907
     Baseline
Job #1902
Regression  Initial JS 4.77MiB(+0.02%) 4.77MiB
No change  Initial CSS 301.31KiB 301.31KiB
Change  Cache Invalidation 53.91% 0%
No change  Chunks 48 48
No change  Assets 152 152
No change  Modules 1377 1377
No change  Duplicate Modules 19 19
No change  Duplicate Code 0.69% 0.69%
No change  Packages 124 124
No change  Duplicate Packages 3 3
Bundle size by type  Change 1 change Regression 1 regression
                 Current
Job #1907
     Baseline
Job #1902
Regression  JS 6.39MiB (+0.01%) 6.39MiB
Not changed  IMG 2MiB 2MiB
Not changed  CSS 316.97KiB 316.97KiB
Not changed  Fonts 93.55KiB 93.55KiB
Not changed  Other 15.48KiB 15.48KiB
Not changed  HTML 13.58KiB 13.58KiB

View job #1907 reportView rpochet:scene_device_feature branch activity

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.

2 participants