Skip to content

Conversation

@adityashibu
Copy link
Member

This pull request introduces several new features and improvements to the energy management system, including setting and fetching energy goals, generating energy reports, and updating the frontend to support these functionalities.

Backend Changes:

  • Added functionality to set and fetch energy goals, including new endpoints /energy_goal and /energy_goal/{goal_value} in backend/fastAPI.py. ([[1]](https://github.com/PowerHouse-Project/Production/pull/37/files#diff-7cee7ba989cfe386199818c80ebf13f54be7d4508e5642a3d5058a3a98db7f59R197-R206), [[2]](https://github.com/PowerHouse-Project/Production/pull/37/files#diff-7cee7ba989cfe386199818c80ebf13f54be7d4508e5642a3d5058a3a98db7f59R262-R277))
  • Created a new function set_energy_goal to save energy goals to a JSON file and get_energy_goal to retrieve them in backend/energy_json.py. ([backend/energy_json.pyR26-R54](https://github.com/PowerHouse-Project/Production/pull/37/files#diff-1007b2553c7d1163870d58de6ffe01133bbc85786bee1e84bc5cbd2d382a22a7R26-R54))
  • Added a new JSON file energy_goal.json to store the energy goal. ([backend/energy/energy_goal.jsonR1-R3](https://github.com/PowerHouse-Project/Production/pull/37/files#diff-7cb0904727ee2a63815e54195fe8f71f7c69cc9ff4be24a813c1c24af11faf35R1-R3))
  • Introduced a new class EnergyReportRequest in backend/fastAPI.py to handle energy report requests. ([backend/fastAPI.pyR69-R77](https://github.com/PowerHouse-Project/Production/pull/37/files#diff-7cee7ba989cfe386199818c80ebf13f54be7d4508e5642a3d5058a3a98db7f59R69-R77))

Frontend Changes:

  • Updated frontend/src/app/ui/dashboard/accountMenu.jsx to include a new menu item and dialog for setting the energy goal. ([[1]](https://github.com/PowerHouse-Project/Production/pull/37/files#diff-c3ad083bd27ed16f2ac45ee16352d815a5ed2a28ceed7e0b65f067b74952221dR14-R19), [[2]](https://github.com/PowerHouse-Project/Production/pull/37/files#diff-c3ad083bd27ed16f2ac45ee16352d815a5ed2a28ceed7e0b65f067b74952221dR35-R36), [[3]](https://github.com/PowerHouse-Project/Production/pull/37/files#diff-c3ad083bd27ed16f2ac45ee16352d815a5ed2a28ceed7e0b65f067b74952221dR171-R185), [[4]](https://github.com/PowerHouse-Project/Production/pull/37/files#diff-c3ad083bd27ed16f2ac45ee16352d815a5ed2a28ceed7e0b65f067b74952221dL191))
  • Added a new component SetEnergyGoalDialog in frontend/src/app/ui/setEnergyGoalDialogue.jsx to handle the user interface for setting energy goals. ([frontend/src/app/ui/setEnergyGoalDialogue.jsxR1-R79](https://github.com/PowerHouse-Project/Production/pull/37/files#diff-f68a6a9bdfaf08bd88341cfaf87148bd401b6cf6b745fa3ff0581f6eb52a9445R1-R79))

Dependency Updates:

  • Added date-fns and react-icons to package.json to support new frontend functionalities. ([package.jsonR21-R28](https://github.com/PowerHouse-Project/Production/pull/37/files#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519R21-R28))

adityashibu and others added 15 commits March 17, 2025 22:51
*Total -- 271.99kb -> 199.08kb (26.8%)

/backend/graphs/monthly_energy_graph.png -- 29.59kb -> 19.93kb (32.65%)
/backend/graphs/daily_energy_graph.png -- 37.74kb -> 26.55kb (29.64%)
/backend/graphs/energy_goal_chart.png -- 28.94kb -> 20.55kb (28.98%)
/backend/graphs/power_rating_bar_chart.png -- 32.12kb -> 23.62kb (26.45%)
/backend/graphs/device_bar_chart.png -- 30.94kb -> 22.77kb (26.39%)
/backend/graphs/gauge_chart.png -- 31.78kb -> 24.08kb (24.23%)
/backend/graphs/device_power_gauge_chart.png -- 34.04kb -> 25.88kb (23.97%)
/backend/graphs/full_gauge_chart.png -- 45.82kb -> 34.84kb (23.95%)
/frontend/public/light-bulb-svgrepo-com.svg -- 1.03kb -> 0.85kb (16.9%)

Signed-off-by: ImgBotApp <ImgBotHelp@gmail.com>
[ImgBot] Optimize images
@adityashibu adityashibu requested a review from david-g-f March 19, 2025 06:01
Copy link
Contributor

@david-g-f david-g-f left a comment

Choose a reason for hiding this comment

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

We did it

@david-g-f david-g-f merged commit dd1a4fe into PowerHouse-Project:main Mar 19, 2025
7 checks passed
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