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

[FRONT] Box Humidity in Room #1045

Merged
merged 27 commits into from
Mar 26, 2021
Merged

Conversation

VonOx
Copy link
Contributor

@VonOx VonOx commented Jan 17, 2021

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)
  • 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.json) 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

New box "Humidity in room" , duplicated from "Temperature in room"

Color is adjusted based on value

Between 45 - 60 % => Green ( Humidity ok )
image

Under 45 => Yellow ( too dry )
image

Below 60% => Blue ( too moist )
image

@codecov
Copy link

codecov bot commented Jan 20, 2021

Codecov Report

Merging #1045 (a6df113) into master (a0232ae) will increase coverage by 0.05%.
The diff coverage is 100.00%.

❗ Current head a6df113 differs from pull request most recent head 185b94a. Consider uploading reports for the commit 185b94a to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1045      +/-   ##
==========================================
+ Coverage   95.80%   95.86%   +0.05%     
==========================================
  Files         533      536       +3     
  Lines        7222     7277      +55     
==========================================
+ Hits         6919     6976      +57     
+ Misses        303      301       -2     
Impacted Files Coverage Δ
server/seeders/20190227081700-device-feature.js 100.00% <ø> (ø)
server/utils/constants.js 100.00% <ø> (ø)
server/api/controllers/room.controller.js 100.00% <100.00%> (ø)
.../device/humidity-sensor/humidity-sensor.command.js 100.00% <100.00%> (ø)
...midity-sensor/humidity-sensor.getHumidityInRoom.js 100.00% <100.00%> (ø)
server/lib/device/humidity-sensor/index.js 100.00% <100.00%> (ø)
server/lib/device/index.js 100.00% <100.00%> (ø)
... and 1 more

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 fecd2e7...185b94a. Read the comment docs.

@VonOx VonOx marked this pull request as ready for review January 20, 2021 12:53
@VonOx VonOx requested review from Pierre-Gilles, cicoub13 and NickDub-old and removed request for cicoub13, Pierre-Gilles and NickDub-old January 22, 2021 15:18
@atrovato
Copy link
Contributor

I think we are go to have a generic "sensor box". Adding a box for each kind of sensor, we'll get a very long list of bashboard boxes.

atrovato
atrovato previously approved these changes Jan 23, 2021
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, didn't test it.

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.

You missed adding your box in the type box list in backend (file server/utils/constant.js)

const DASHBOARD_BOX_TYPE = {
  WEATHER: 'weather',
  TEMPERATURE_IN_ROOM: 'temperature-in-room',
  HUMIDITY_IN_ROOM: 'humidity-in-room',
  USER_PRESENCE: 'user-presence',
  CAMERA: 'camera',
  DEVICES_IN_ROOM: 'devices-in-room',
};

And I think the backend call with ?expand=humidity doesn't seem to work.

humidity-box

@VonOx VonOx changed the title [FRONT] Box Humidity in Room WIP [FRONT] Box Humidity in Room Jan 25, 2021
@VonOx VonOx changed the title WIP [FRONT] Box Humidity in Room [FRONT] Box Humidity in Room Jan 27, 2021
@VonOx VonOx changed the title [FRONT] Box Humidity in Room WIP [FRONT] Box Humidity in Room Jan 30, 2021
@VonOx VonOx changed the title WIP [FRONT] Box Humidity in Room [FRONT] Box Humidity in Room Mar 9, 2021
@atrovato
Copy link
Contributor

Now you miss tests on error cases... courage!

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.

Some code improvment.

@VonOx VonOx requested a review from cicoub13 March 13, 2021 19:33
atrovato
atrovato previously approved these changes Mar 14, 2021
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.

👍

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.

Doesn't feel quite natural:

Screenshot 2021-03-22 at 15 21 13

@VonOx
Copy link
Contributor Author

VonOx commented Mar 22, 2021

@Pierre-Gilles You are right , I've commit a better answer

@VonOx VonOx requested a review from Pierre-Gilles March 22, 2021 08:30
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.

A few feedbacks

server/config/brain/humidity-sensor/answers.fr.json Outdated Show resolved Hide resolved
server/config/brain/humidity-sensor/answers.en.json Outdated Show resolved Hide resolved
server/config/brain/humidity-sensor/answers.en.json Outdated Show resolved Hide resolved
server/config/brain/humidity-sensor/answers.fr.json Outdated Show resolved Hide resolved
@VonOx VonOx requested a review from Pierre-Gilles March 25, 2021 09:34
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.

Looks good to me except a small typo :)

server/config/brain/humidity-sensor/answers.fr.json Outdated Show resolved Hide resolved
@VonOx VonOx requested a review from Pierre-Gilles March 26, 2021 06:51
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.

Good to me now!

@Pierre-Gilles Pierre-Gilles merged commit dfece6b into GladysAssistant:master Mar 26, 2021
@VonOx VonOx deleted the new-box branch April 20, 2021 08:44
Jean-PhilippeD pushed a commit to Jean-PhilippeD/Gladys that referenced this pull request Oct 13, 2021
Co-authored-by: Pierre-Gilles Leymarie <pierregilles.leymarie@gmail.com>
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.

4 participants