632 Commits

Author SHA1 Message Date
28a952236a Update Rust crate jsonwebtoken to 10.2.0
Some checks failed
continuous-integration/drone/push Build is failing
2025-12-02 00:18:41 +00:00
9f8158357e Merge pull request 'Update Rust crate egui to 0.33.2' (#378) from renovate/egui-0.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-12-01 00:19:01 +00:00
7b7a4a7144 Update Rust crate egui to 0.33.2
Some checks failed
renovate/artifacts Artifact file update failure
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-12-01 00:18:57 +00:00
d2b2790c41 Merge pull request 'Update dependency typescript-eslint to ^8.48.0' (#377) from renovate/typescript-eslint-8.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-12-01 00:18:35 +00:00
3d6422757d Update dependency typescript-eslint to ^8.48.0
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2025-11-30 00:18:33 +00:00
2d13fa5aab Merge pull request 'Update dependency globals to ^16.5.0' (#376) from renovate/globals-16.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-30 00:18:23 +00:00
404539f5cd Update dependency globals to ^16.5.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-11-29 00:20:02 +00:00
99ea7bae93 Merge pull request 'Update dependency @mui/x-charts to ^8.20.0' (#375) from renovate/mui-x-charts-8.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-29 00:19:56 +00:00
6e49afb29a Update dependency @mui/x-charts to ^8.20.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-11-28 00:18:45 +00:00
a17aa1c11e Merge pull request 'Update dependency @typescript-eslint/parser to ^8.48.0' (#374) from renovate/typescript-eslint-parser-8.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-28 00:18:37 +00:00
964a26e535 Update dependency @typescript-eslint/parser to ^8.48.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-11-27 00:21:05 +00:00
f41b266da1 Merge pull request 'Update dependency @typescript-eslint/eslint-plugin to ^8.48.0' (#373) from renovate/typescript-eslint-eslint-plugin-8.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-27 00:20:59 +00:00
b01b6732dd Update dependency @typescript-eslint/eslint-plugin to ^8.48.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-11-26 00:14:09 +00:00
c217e5f944 Merge pull request 'Update dependency @types/react to ^19.2.7' (#372) from renovate/react into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-26 00:14:01 +00:00
247d1dd4ec Update dependency @types/react to ^19.2.7
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-11-25 00:13:44 +00:00
c6a43ec868 Merge pull request 'Update dependency @fontsource/roboto to ^5.2.9' (#371) from renovate/fontsource-roboto-5.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-25 00:13:37 +00:00
53a1c7e0e9 Update dependency @fontsource/roboto to ^5.2.9
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-11-24 00:14:10 +00:00
852c58b560 Merge pull request 'Update dependency @mui/x-date-pickers to ^8.19.0' (#370) from renovate/mui-x-date-pickers-8.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-24 00:14:01 +00:00
cb28426b23 Update dependency @mui/x-date-pickers to ^8.19.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-11-23 00:16:31 +00:00
4a2828aa0c Merge pull request 'Update dependency @mui/x-charts to ^8.19.0' (#369) from renovate/mui-x-charts-8.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-23 00:16:22 +00:00
26502589ac Update dependency @mui/x-charts to ^8.19.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-11-22 00:13:56 +00:00
f0d210782e Merge pull request 'Update Rust crate rand to 0.10.0-rc.5' (#368) from renovate/rand-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-22 00:13:47 +00:00
1f1c16fc9c Update Rust crate rand to 0.10.0-rc.5
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-11-21 00:18:32 +00:00
16f0c9cee2 Merge pull request 'Update Rust crate clap to 4.5.53' (#367) from renovate/clap-4.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-21 00:18:23 +00:00
ae001316d5 Update Rust crate clap to 4.5.53
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-11-20 00:14:58 +00:00
572b43d9ac Merge pull request 'Update react' (#366) from renovate/react into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-20 00:14:33 +00:00
c6c4eae7a2 Update react
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-11-19 00:13:36 +00:00
831d4d444c Merge pull request 'Update dependency date-and-time to ^4.1.1' (#365) from renovate/date-and-time-4.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-19 00:13:31 +00:00
cd19f1d69b Update dependency date-and-time to ^4.1.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-11-18 00:15:41 +00:00
4ca2d7a763 Merge pull request 'Update Rust crate openssl-sys to 0.9.111' (#364) from renovate/openssl-sys-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-18 00:15:33 +00:00
9c7df89bce Update Rust crate openssl-sys to 0.9.111
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-11-17 00:14:07 +00:00
040def4089 Merge pull request 'Update dependency react-router-dom to ^7.9.6' (#363) from renovate/react-router-dom-7.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-17 00:13:56 +00:00
ad27b656f4 Update dependency react-router-dom to ^7.9.6
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-11-16 00:14:39 +00:00
53e4d09d6e Merge pull request 'Update dependency @vitejs/plugin-react to ^5.1.1' (#362) from renovate/vitejs-plugin-react-5.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-16 00:14:33 +00:00
e0199b8ce9 Update dependency @vitejs/plugin-react to ^5.1.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-11-15 00:14:26 +00:00
26c301d8ac Merge pull request 'Update dependency @typescript-eslint/parser to ^8.46.4' (#361) from renovate/typescript-eslint-parser-8.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-15 00:14:17 +00:00
ab9ed2ad63 Update dependency @typescript-eslint/parser to ^8.46.4
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-11-13 00:13:46 +00:00
38f06b45b9 Merge pull request 'Update dependency @types/react to ^19.2.3' (#360) from renovate/react into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-11-12 00:15:26 +00:00
bfa6dfad0c Update dependency @types/react to ^19.2.3
Some checks failed
renovate/artifacts Artifact file update failure
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-11-12 00:15:23 +00:00
cb06524706 Merge pull request 'Update dependency @typescript-eslint/eslint-plugin to ^8.46.4' (#359) from renovate/typescript-eslint-eslint-plugin-8.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-11-11 00:18:22 +00:00
517b6a2575 Update dependency @typescript-eslint/eslint-plugin to ^8.46.4
Some checks failed
renovate/artifacts Artifact file update failure
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-11-11 00:18:14 +00:00
98c30ca164 Merge pull request 'Update Rust crate openssl to 0.10.75' (#358) from renovate/openssl-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-11 00:18:09 +00:00
a6b5151120 Update Rust crate openssl to 0.10.75
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2025-11-10 00:15:36 +00:00
8ecbcf7177 Merge pull request 'Update dependency typescript-eslint to ^8.46.3' (#357) from renovate/typescript-eslint-8.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-10 00:14:34 +00:00
c861f84967 Update dependency typescript-eslint to ^8.46.3
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-11-09 00:16:42 +00:00
75d566e4be Merge pull request 'Update dependency @mui/x-date-pickers to ^8.17.0' (#356) from renovate/mui-x-date-pickers-8.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-09 00:16:31 +00:00
42457901b1 Update dependency @mui/x-date-pickers to ^8.17.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-11-08 00:13:21 +00:00
849ee1121d Merge pull request 'Update dependency @typescript-eslint/parser to ^8.46.3' (#355) from renovate/typescript-eslint-parser-8.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-08 00:13:13 +00:00
af9d1a9a74 Update dependency @typescript-eslint/parser to ^8.46.3
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-11-07 00:15:51 +00:00
07e3a7b371 Merge pull request 'Update materialui to ^7.3.5' (#354) from renovate/materialui into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-11-06 00:16:52 +00:00
be6f57ce17 Update materialui to ^7.3.5
Some checks failed
renovate/artifacts Artifact file update failure
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-11-06 00:16:39 +00:00
46870340a7 Merge pull request 'Update dependency eslint to ^9.39.1' (#353) from renovate/eslint-9.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-11-05 00:14:54 +00:00
527ef86714 Update dependency eslint to ^9.39.1
Some checks failed
renovate/artifacts Artifact file update failure
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-11-05 00:14:48 +00:00
b7d97218d7 Merge pull request 'Update dependency @mui/x-date-pickers to ^8.16.0' (#352) from renovate/mui-x-date-pickers-8.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-11-05 00:14:47 +00:00
d8ebf6845d Update dependency @mui/x-date-pickers to ^8.16.0
Some checks failed
renovate/artifacts Artifact file update failure
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-11-05 00:14:38 +00:00
ba8bfffc1b Merge pull request 'Update dependency @typescript-eslint/eslint-plugin to ^8.46.3' (#351) from renovate/typescript-eslint-eslint-plugin-8.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-11-04 00:19:21 +00:00
ff44859c2d Update dependency @typescript-eslint/eslint-plugin to ^8.46.3
Some checks failed
renovate/artifacts Artifact file update failure
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-11-04 00:19:12 +00:00
66923ab226 Merge pull request 'Update dependency @mui/x-charts to ^8.16.0' (#350) from renovate/mui-x-charts-8.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-04 00:18:51 +00:00
3f3b1282bd Update dependency @mui/x-charts to ^8.16.0
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2025-11-03 00:14:46 +00:00
95a1a446db Merge pull request 'Update Rust crate lazy-regex to 3.4.2' (#349) from renovate/lazy-regex-3.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-03 00:14:38 +00:00
f5fe5b5339 Update Rust crate lazy-regex to 3.4.2
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-11-02 00:14:30 +00:00
c844490c4e Merge pull request 'Update dependency dayjs to ^1.11.19' (#348) from renovate/dayjs-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-02 00:14:20 +00:00
fe951f4004 Update dependency dayjs to ^1.11.19
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-11-01 00:15:11 +00:00
8c92b8bf27 Merge pull request 'Update Rust crate clap to 4.5.51' (#347) from renovate/clap-4.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-11-01 00:15:02 +00:00
8d715b407e Update Rust crate clap to 4.5.51
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-10-31 00:42:02 +00:00
f11d25b2f0 Merge pull request 'Update dependency react-router-dom to ^7.9.5' (#346) from renovate/react-router-dom-7.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-31 00:41:48 +00:00
35e64e977b Update dependency react-router-dom to ^7.9.5
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-10-30 00:42:17 +00:00
4d46f9c52c Bump to version 1.0.3
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2025-10-29 18:01:00 +01:00
c90a05fcfd Auto-publish releases to Gitea
Some checks failed
continuous-integration/drone/push Build is failing
2025-10-29 17:54:44 +01:00
abdca20a66 Can set relay forced state from UI
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-29 17:49:03 +01:00
88a24565b4 Add new engine tests for forced state
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-29 16:12:17 +01:00
3625188706 Can set forced state to relays 2025-10-29 15:49:05 +01:00
58eceeda2d Update project dependencies
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-29 14:53:29 +01:00
c44c6c3bf5 Remove redundant declaration with upgrade to ESP-IDF v5.5.1
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-29 14:38:18 +01:00
4ef714fdbd Merge pull request 'Update espressif/idf Docker tag to v5.5.1' (#344) from renovate/espressif-idf-5.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-10-29 00:41:41 +00:00
bab4525908 Update espressif/idf Docker tag to v5.5.1
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-10-28 00:52:20 +00:00
2ed4299032 Merge pull request 'Update Rust crate reqwest to 0.12.24' (#343) from renovate/reqwest-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-28 00:52:15 +00:00
bcc92da065 Update Rust crate reqwest to 0.12.24
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-10-27 00:42:22 +00:00
af83130b63 Merge pull request 'Update Rust crate actix-session to 0.11.0' (#342) from renovate/actix-session-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-26 00:42:55 +00:00
950b576373 Update Rust crate actix-session to 0.11.0
Some checks failed
renovate/artifacts Artifact file update failure
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is passing
2025-10-26 00:42:45 +00:00
2459b0cf99 Merge pull request 'Update Rust crate clap to 4.5.50' (#341) from renovate/clap-4.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-26 00:42:02 +00:00
814204b4ce Update Rust crate clap to 4.5.50
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-10-25 00:42:07 +00:00
de8fcfbcfb Merge pull request 'Update dependency typescript-eslint to ^8.46.2' (#340) from renovate/typescript-eslint-8.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-25 00:41:33 +00:00
49a7011d84 Update dependency typescript-eslint to ^8.46.2
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-10-24 00:42:39 +00:00
39aff8054a Merge pull request 'Update dependency @typescript-eslint/parser to ^8.46.2' (#339) from renovate/typescript-eslint-parser-8.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-24 00:42:31 +00:00
850f828dca Update dependency @typescript-eslint/parser to ^8.46.2
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-10-23 00:41:26 +00:00
59383debd2 Merge pull request 'Update dependency vite to ^6.4.1' (#338) from renovate/vite-6.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-10-22 00:42:45 +00:00
58cf0a9614 Update dependency vite to ^6.4.1
Some checks failed
renovate/artifacts Artifact file update failure
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-10-22 00:42:40 +00:00
f30aaf71dd Merge pull request 'Update dependency eslint to ^9.38.0' (#337) from renovate/eslint-9.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-10-22 00:42:37 +00:00
27ce9e9a96 Update dependency eslint to ^9.38.0
Some checks failed
renovate/artifacts Artifact file update failure
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-10-22 00:42:30 +00:00
903dd104f3 Merge pull request 'Update dependency @typescript-eslint/eslint-plugin to ^8.46.2' (#336) from renovate/typescript-eslint-eslint-plugin-8.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-10-21 00:43:01 +00:00
205981fbc8 Update dependency @typescript-eslint/eslint-plugin to ^8.46.2
Some checks failed
renovate/artifacts Artifact file update failure
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-10-21 00:42:57 +00:00
623b0a4671 Merge pull request 'Update Rust crate openssl-sys to 0.9.110' (#335) from renovate/openssl-sys-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-21 00:42:51 +00:00
fd25e71cf8 Update Rust crate openssl-sys to 0.9.110
Some checks failed
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is failing
2025-10-20 00:40:59 +00:00
842b48e782 Merge pull request 'Update react' (#331) from renovate/react into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-20 00:40:53 +00:00
e8374a8ef7 Update react
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-10-19 00:42:05 +00:00
347c247285 Merge pull request 'Update dependency typescript-eslint to ^8.46.1' (#213) from renovate/typescript-eslint-8.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-19 00:41:57 +00:00
c59aeed4ab Merge pull request 'Update Rust crate openssl to 0.10.74' (#334) from renovate/openssl-0.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-10-19 00:41:57 +00:00
b7f1beb1b7 Merge pull request 'Update Rust crate clap to 4.5.49' (#333) from renovate/clap-4.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-10-19 00:41:51 +00:00
4bd700c2db Update dependency typescript-eslint to ^8.46.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-10-18 00:42:04 +00:00
3f1c5e4ac0 Update Rust crate openssl to 0.10.74
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is passing
2025-10-18 00:42:00 +00:00
f77506dc46 Update Rust crate clap to 4.5.49
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is passing
2025-10-18 00:41:58 +00:00
5b7554b6bf Merge pull request 'Update dependency eslint-plugin-react-refresh to ^0.4.24' (#332) from renovate/eslint-plugin-react-refresh-0.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-10-17 00:41:35 +00:00
8fdbcc4f3a Update dependency eslint-plugin-react-refresh to ^0.4.24
Some checks failed
renovate/artifacts Artifact file update failure
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-10-17 00:41:33 +00:00
9f4c2b0e35 Merge pull request 'Update dependency react-router-dom to ^7.9.4' (#329) from renovate/react-router-dom-7.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-10-16 00:42:44 +00:00
0a7138a82b Update dependency react-router-dom to ^7.9.4
Some checks failed
renovate/artifacts Artifact file update failure
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-10-16 00:42:39 +00:00
2ce09a94b1 Merge pull request 'Update dependency @typescript-eslint/parser to ^8.46.1' (#330) from renovate/typescript-eslint-parser-8.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-10-16 00:42:38 +00:00
355b2a71ce Update dependency @typescript-eslint/parser to ^8.46.1
Some checks failed
renovate/artifacts Artifact file update failure
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is failing
2025-10-16 00:42:36 +00:00
6b04bf4261 Merge pull request 'Update dependency @typescript-eslint/eslint-plugin to ^8.46.1' (#328) from renovate/typescript-eslint-eslint-plugin-8.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-10-15 01:12:06 +00:00
99c6963210 Update dependency @typescript-eslint/eslint-plugin to ^8.46.1
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-10-14 00:43:10 +00:00
89cfd3ce21 Merge pull request 'Update dependency typescript to ^5.9.3' (#327) from renovate/typescript-5.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-13 00:42:47 +00:00
0c40ff2750 Update dependency typescript to ^5.9.3
Some checks failed
renovate/artifacts Artifact file update failure
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is passing
2025-10-13 00:42:39 +00:00
75be1ed1d2 Merge pull request 'Update dependency globals to ^16.4.0' (#326) from renovate/globals-16.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-13 00:42:30 +00:00
6a2baca3f2 Update dependency globals to ^16.4.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-10-12 00:40:56 +00:00
4d0d20b424 Merge pull request 'Update dependency eslint to ^9.37.0' (#325) from renovate/eslint-9.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-12 00:40:50 +00:00
05cf488be7 Update dependency eslint to ^9.37.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-10-11 00:40:53 +00:00
b8ecc83668 Merge pull request 'Update Rust crate libc to 0.2.177' (#324) from renovate/libc-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-11 00:40:45 +00:00
c1912717e4 Update Rust crate libc to 0.2.177
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-10-10 00:39:58 +00:00
a8780e60d3 Merge pull request 'Update dependency semver to ^7.7.3' (#323) from renovate/semver-7.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-10 00:39:51 +00:00
5005cf84f9 Update dependency semver to ^7.7.3
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-10-09 00:16:46 +00:00
561992010c Merge pull request 'Update dependency @typescript-eslint/parser to ^8.46.0' (#322) from renovate/typescript-eslint-parser-8.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-09 00:16:39 +00:00
4725e67ee1 Update dependency @typescript-eslint/parser to ^8.46.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-10-08 00:16:47 +00:00
fbb55628be Merge pull request 'Update dependency @typescript-eslint/eslint-plugin to ^8.46.0' (#321) from renovate/typescript-eslint-eslint-plugin-8.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-08 00:16:39 +00:00
79e49ed5a9 Update dependency @typescript-eslint/eslint-plugin to ^8.46.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-10-07 00:17:12 +00:00
138b9d2dbe Merge pull request 'Update materialui to ^7.3.4' (#219) from renovate/materialui into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-07 00:17:05 +00:00
3413a1ee21 Update materialui to ^7.3.4
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-10-06 00:18:40 +00:00
64055568e0 Merge pull request 'Update dependency @typescript-eslint/eslint-plugin to ^8.45.0' (#320) from renovate/typescript-eslint-eslint-plugin-8.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-06 00:18:25 +00:00
af71b574cc Update dependency @typescript-eslint/eslint-plugin to ^8.45.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-10-05 00:18:58 +00:00
6088237b79 Merge pull request 'Update Rust crate thiserror to 2.0.17' (#319) from renovate/thiserror-2.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-05 00:18:50 +00:00
05a033b51c Update Rust crate thiserror to 2.0.17
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-10-04 00:41:16 +00:00
3d3ccf5242 Merge pull request 'Update Rust crate serde_json to 1.0.145' (#318) from renovate/serde_json-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-04 00:41:09 +00:00
68521c238c Update Rust crate serde_json to 1.0.145
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-10-03 00:41:45 +00:00
f03278f8c5 Merge pull request 'Update dependency eslint-plugin-react-refresh to ^0.4.23' (#317) from renovate/eslint-plugin-react-refresh-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-03 00:41:38 +00:00
a63d1f17de Update dependency eslint-plugin-react-refresh to ^0.4.23
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-10-02 00:40:56 +00:00
bb6d8a8be1 Merge pull request 'Update Rust crate serde to 1.0.228' (#316) from renovate/serde-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-02 00:40:49 +00:00
693414b1eb Update Rust crate serde to 1.0.228
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-10-01 00:39:51 +00:00
f74e86a8db Merge pull request 'Update Rust crate libc to 0.2.176' (#315) from renovate/libc-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-10-01 00:39:40 +00:00
53d4cb1de7 Update Rust crate libc to 0.2.176
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-09-30 00:39:28 +00:00
498ca3925a Merge pull request 'Update dependency @types/react to ^19.1.15' (#314) from renovate/react into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-30 00:39:21 +00:00
155806df78 Update dependency @types/react to ^19.1.15
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-09-29 00:40:04 +00:00
79f3668021 Merge pull request 'Update dependency eslint-plugin-react-refresh to ^0.4.22' (#313) from renovate/eslint-plugin-react-refresh-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-29 00:39:58 +00:00
660e6e8a5b Update dependency eslint-plugin-react-refresh to ^0.4.22
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-09-28 00:39:53 +00:00
0e3182434f Merge pull request 'Update dependency @types/react to ^19.1.14' (#312) from renovate/react into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-28 00:39:47 +00:00
cf2f034e6c Update dependency @types/react to ^19.1.14
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-09-27 00:41:27 +00:00
ddd27519a9 Merge pull request 'Update dependency @typescript-eslint/parser to ^8.44.1' (#311) from renovate/typescript-eslint-parser-8.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-27 00:41:21 +00:00
e8d2e8b318 Update dependency @typescript-eslint/parser to ^8.44.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-09-26 00:39:55 +00:00
0dfc25a918 Merge pull request 'Update dependency @typescript-eslint/eslint-plugin to ^8.44.1' (#310) from renovate/typescript-eslint-eslint-plugin-8.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-26 00:39:47 +00:00
3078b3c645 Update dependency @typescript-eslint/eslint-plugin to ^8.44.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-09-24 00:43:54 +00:00
9d3bed68af Merge pull request 'Update Rust crate serde to 1.0.226' (#309) from renovate/serde-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-24 00:43:32 +00:00
9fe00f149c Update Rust crate serde to 1.0.226
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-09-22 00:44:39 +00:00
65164055d6 Merge pull request 'Update Rust crate clap to 4.5.48' (#308) from renovate/clap-4.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-22 00:44:23 +00:00
08680122f2 Update Rust crate clap to 4.5.48
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-09-21 00:45:22 +00:00
642366540e Merge pull request 'Update Rust crate anyhow to 1.0.100' (#307) from renovate/anyhow-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-21 00:45:07 +00:00
482da63a3b Update Rust crate anyhow to 1.0.100
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-09-20 00:41:46 +00:00
cade9dc02b Merge pull request 'Update Rust crate serde to 1.0.225' (#306) from renovate/serde-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-20 00:41:31 +00:00
9b87025b27 Update Rust crate serde to 1.0.225
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-09-19 00:39:44 +00:00
46d3f3580c Merge pull request 'Update dependency @fontsource/roboto to ^5.2.8' (#305) from renovate/fontsource-roboto-5.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-19 00:39:36 +00:00
bda9f6a9c9 Update dependency @fontsource/roboto to ^5.2.8
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-09-18 00:40:56 +00:00
41380a103f Merge pull request 'Update Rust crate semver to 1.0.27' (#304) from renovate/semver-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-18 00:40:50 +00:00
2573778b82 Update Rust crate semver to 1.0.27
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-09-17 00:40:21 +00:00
527126d926 Merge pull request 'Update Rust crate egui to 0.32.3' (#303) from renovate/egui-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-17 00:40:14 +00:00
9a1104c57b Update Rust crate egui to 0.32.3
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-09-16 00:40:23 +00:00
bf3e703bb1 Merge pull request 'Update dependency @fontsource/roboto to ^5.2.7' (#302) from renovate/fontsource-roboto-5.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-16 00:40:15 +00:00
d7607bc483 Update dependency @fontsource/roboto to ^5.2.7
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-09-15 00:40:22 +00:00
306be8272a Merge pull request 'Update Rust crate eframe to 0.32.3' (#301) from renovate/eframe-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-15 00:40:16 +00:00
742bb8e2ed Update Rust crate eframe to 0.32.3
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-09-14 00:40:52 +00:00
e10d7ef478 Merge pull request 'Update dependency @types/react to ^19.1.13' (#300) from renovate/react into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-14 00:40:43 +00:00
18ba6c60d6 Update dependency @types/react to ^19.1.13
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-09-13 00:41:05 +00:00
d70562f97a Merge pull request 'Update Rust crate thiserror to 2.0.16' (#299) from renovate/thiserror-2.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-13 00:40:59 +00:00
b0d192a9aa Update Rust crate thiserror to 2.0.16
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-09-12 00:40:22 +00:00
99f6b17f4e Merge pull request 'Update Rust crate serde_json to 1.0.143' (#298) from renovate/serde_json-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-12 00:40:14 +00:00
3fff4d624e Update Rust crate serde_json to 1.0.143
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-09-11 00:38:58 +00:00
e2f6212a75 Merge pull request 'Update Rust crate chrono to 0.4.42' (#297) from renovate/chrono-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-11 00:38:50 +00:00
bff1c88da8 Update Rust crate chrono to 0.4.42
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-09-10 00:39:13 +00:00
7933c2dae3 Merge pull request 'Update dependency vite to ^6.3.6' (#296) from renovate/vite-6.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-10 00:39:06 +00:00
15b8a69700 Update dependency vite to ^6.3.6
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-09-09 00:39:21 +00:00
157c77142a Merge pull request 'Update Rust crate reqwest to 0.12.23' (#295) from renovate/reqwest-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-09 00:39:14 +00:00
25f6e808ed Update Rust crate reqwest to 0.12.23
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-09-08 00:40:15 +00:00
6f298d3238 Merge pull request 'Update Rust crate log to 0.4.28' (#294) from renovate/log-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-08 00:40:07 +00:00
b75e868cc3 Update Rust crate log to 0.4.28
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-09-07 00:40:29 +00:00
6a2b5e320d Merge pull request 'Update Rust crate egui to 0.32.2' (#293) from renovate/egui-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-07 00:40:18 +00:00
52637fc401 Update Rust crate egui to 0.32.2
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-09-06 00:40:20 +00:00
8ea9da9443 Merge pull request 'Update Rust crate eframe to 0.32.2' (#292) from renovate/eframe-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-06 00:40:09 +00:00
b1b4eaa341 Update Rust crate eframe to 0.32.2
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-09-05 00:25:56 +00:00
94652a82fe Merge pull request 'Update dependency @types/semver to ^7.7.1' (#291) from renovate/semver-7.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-05 00:25:47 +00:00
832ab86536 Update dependency @types/semver to ^7.7.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-09-04 00:33:25 +00:00
32dbbf4678 Merge pull request 'Update Rust crate clap to 4.5.47' (#290) from renovate/clap-4.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-04 00:33:19 +00:00
1f48203564 Update Rust crate clap to 4.5.47
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-09-03 00:32:03 +00:00
0b6526f901 Merge pull request 'Update Rust crate libc to 0.2.175' (#289) from renovate/libc-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-03 00:31:53 +00:00
741db9e13b Update Rust crate libc to 0.2.175
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-09-02 00:32:19 +00:00
061ae8c208 Merge pull request 'Update Rust crate clap to 4.5.46' (#288) from renovate/clap-4.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-02 00:32:11 +00:00
4a68800907 Update Rust crate clap to 4.5.46
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-09-01 00:31:05 +00:00
6738d47507 Merge pull request 'Update dependency dayjs to ^1.11.18' (#287) from renovate/dayjs-1.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-09-01 00:30:56 +00:00
acbce81b46 Update dependency dayjs to ^1.11.18
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-08-31 00:30:49 +00:00
1615531d67 Fix improper label in OTA deployment dialog
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-30 13:27:48 +00:00
5355b351d1 Merge pull request 'Update react' (#286) from renovate/react into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-30 00:30:32 +00:00
ad10df3e7f Update react
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-08-29 00:32:24 +00:00
edf70cb8fc Merge pull request 'Update dependency @typescript-eslint/parser to ^8.41.0' (#265) from renovate/typescript-eslint-parser-8.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-29 00:32:16 +00:00
8af3018b34 Update dependency @typescript-eslint/parser to ^8.41.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-08-28 00:32:18 +00:00
dd96cc4bf3 Fix cargo clippy issues
All checks were successful
continuous-integration/drone/push Build is passing
2025-08-27 08:28:45 +02:00
9e9a227332 Fix issue with asn1 crate update
Some checks failed
continuous-integration/drone/push Build is failing
2025-08-27 08:25:46 +02:00
d701c406d6 Merge pull request 'Update Rust crate egui to 0.32.1' (#285) from renovate/egui-0.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-08-26 00:30:54 +00:00
74915f109d Update Rust crate egui to 0.32.1
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-08-25 00:30:47 +00:00
40af167c1a Merge pull request 'Update dependency @types/react to ^19.1.11' (#284) from renovate/react into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-08-24 00:30:48 +00:00
124fc71c9a Update dependency @types/react to ^19.1.11
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-08-23 00:31:40 +00:00
ac6f93dd4a Merge pull request 'Update Rust crate eframe to 0.32.1' (#283) from renovate/eframe-0.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-08-22 00:31:16 +00:00
695fa1fcf4 Update Rust crate eframe to 0.32.1
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-08-21 00:31:48 +00:00
3131c757a9 Merge pull request 'Update Rust crate clap to 4.5.45' (#282) from renovate/clap-4.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-08-20 00:31:30 +00:00
60d5be58e1 Update Rust crate clap to 4.5.45
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-08-19 00:31:23 +00:00
4b90e0ede1 Merge pull request 'Update Rust crate anyhow to 1.0.99' (#281) from renovate/anyhow-1.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-08-18 00:30:24 +00:00
d351aebce4 Update Rust crate anyhow to 1.0.99
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-08-17 00:31:50 +00:00
24d95fff89 Merge pull request 'Update dependency @typescript-eslint/eslint-plugin to ^8.39.1' (#280) from renovate/typescript-eslint-eslint-plugin-8.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-08-16 00:30:22 +00:00
11e536fee0 Update dependency @typescript-eslint/eslint-plugin to ^8.39.1
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-08-15 00:31:43 +00:00
e2328b47e5 Merge pull request 'Update dependency @types/react to ^19.1.10' (#279) from renovate/react into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-08-14 00:31:26 +00:00
bc790df8e6 Update dependency @types/react to ^19.1.10
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-08-13 00:31:57 +00:00
104e4f2c15 Merge pull request 'Update dependency eslint to ^9.33.0' (#278) from renovate/eslint-9.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-08-12 00:31:07 +00:00
709671c35d Update dependency eslint to ^9.33.0
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-08-11 00:31:14 +00:00
e769b2d83b Merge pull request 'Update dependency @typescript-eslint/eslint-plugin to ^8.39.0' (#277) from renovate/typescript-eslint-eslint-plugin-8.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-08-10 00:30:19 +00:00
33c3769818 Update dependency @typescript-eslint/eslint-plugin to ^8.39.0
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-08-09 00:30:41 +00:00
7c5eeaeaa0 Merge pull request 'Update Rust crate clap to 4.5.43' (#276) from renovate/clap-4.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-08-08 00:18:59 +00:00
bcdb72e217 Update Rust crate clap to 4.5.43
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-08-07 00:19:29 +00:00
7173d206f2 Merge pull request 'Update Rust crate tokio to 1.47.1' (#275) from renovate/tokio-1.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-08-06 00:18:40 +00:00
74a8d3ffbf Update Rust crate tokio to 1.47.1
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-08-05 00:18:26 +00:00
31bc7898ee Merge pull request 'Update Rust crate serde_json to 1.0.142' (#274) from renovate/serde_json-1.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-08-04 00:18:39 +00:00
27a6d8f7ed Update Rust crate serde_json to 1.0.142
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-08-03 00:21:42 +00:00
43c988b80e Merge pull request 'Update Rust crate clap to 4.5.42' (#273) from renovate/clap-4.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-08-02 00:20:39 +00:00
9531281fd2 Update Rust crate clap to 4.5.42
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-08-01 00:23:15 +00:00
e589e2e80c Merge pull request 'Update react' (#272) from renovate/react into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-07-31 00:18:34 +00:00
36c127a9c9 Update react
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-07-30 00:17:50 +00:00
f0b9683519 Merge pull request 'Update Rust crate uuid to 1.17.0' (#271) from renovate/uuid-1.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-07-28 00:19:56 +00:00
2e793770f1 Update Rust crate uuid to 1.17.0
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is failing
2025-07-28 00:19:53 +00:00
ceac6a2683 Merge pull request 'Update Rust crate tokio to 1.47.0' (#270) from renovate/tokio-1.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-07-27 00:19:24 +00:00
f232a63496 Update Rust crate tokio to 1.47.0
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-07-27 00:19:23 +00:00
adfe006270 Merge pull request 'Update dependency eslint to ^9.32.0' (#269) from renovate/eslint-9.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-07-26 00:19:07 +00:00
aa6ca82edd Update dependency eslint to ^9.32.0
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is failing
2025-07-26 00:19:04 +00:00
d939752aed Merge pull request 'Update dependency react-router-dom to ^7.7.1' (#268) from renovate/react-router-dom-7.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-07-25 00:20:02 +00:00
ca6532aee3 Update dependency react-router-dom to ^7.7.1
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-07-25 00:19:59 +00:00
bd5fc18bab Merge pull request 'Update Rust crate tokio to 1.46.1' (#267) from renovate/tokio-1.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-07-24 00:20:13 +00:00
80023ddee3 Update Rust crate tokio to 1.46.1
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-07-24 00:20:09 +00:00
d48094aca6 Merge pull request 'Update Rust crate rust-embed to 8.7.2' (#266) from renovate/rust-embed-8.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-07-23 00:19:38 +00:00
47e59b7035 Update Rust crate rust-embed to 8.7.2
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is failing
2025-07-23 00:19:35 +00:00
6eb9e3df09 Merge pull request 'Update dependency @typescript-eslint/eslint-plugin to ^8.38.0' (#264) from renovate/typescript-eslint-eslint-plugin-8.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-07-22 00:23:12 +00:00
0d5f2b90eb Update dependency @typescript-eslint/eslint-plugin to ^8.38.0
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is failing
2025-07-22 00:23:07 +00:00
8f181ec485 Merge pull request 'Update Rust crate egui to 0.32.0' (#263) from renovate/egui-0.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-07-21 00:20:42 +00:00
7bb92f7e05 Update Rust crate egui to 0.32.0
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-07-21 00:20:37 +00:00
2f2a77f780 Merge pull request 'Update Rust crate rand to 0.9.2' (#262) from renovate/rand-0.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-07-21 00:20:27 +00:00
789c30faf8 Update Rust crate rand to 0.9.2
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is failing
2025-07-21 00:20:24 +00:00
2a9bc65f54 Merge pull request 'Update Rust crate eframe to 0.32.0' (#261) from renovate/eframe-0.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-07-20 00:17:57 +00:00
2b96e2a294 Update Rust crate eframe to 0.32.0
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-07-20 00:17:53 +00:00
0092d09ff9 Merge pull request 'Update dependency @vitejs/plugin-react to ^4.7.0' (#260) from renovate/vitejs-plugin-react-4.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-07-20 00:17:38 +00:00
4bdda28ebf Update dependency @vitejs/plugin-react to ^4.7.0
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is failing
2025-07-20 00:17:36 +00:00
83e130d232 Merge pull request 'Update Rust crate serde_json to 1.0.141' (#259) from renovate/serde_json-1.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-07-19 00:21:31 +00:00
15c394a797 Update Rust crate serde_json to 1.0.141
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is failing
2025-07-19 00:21:28 +00:00
66257b2866 Merge pull request 'Update Rust crate asn1 to 0.22.0' (#258) from renovate/asn1-0.x into master
Some checks failed
continuous-integration/drone/push Build is failing
2025-07-19 00:21:22 +00:00
140f1449a7 Merge pull request 'Update Rust crate libc to 0.2.174' (#235) from renovate/libc-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-07-19 00:21:15 +00:00
71b0e54529 Update Rust crate asn1 to 0.22.0
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-07-18 00:18:44 +00:00
4fff948382 Update Rust crate libc to 0.2.174
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-07-18 00:18:32 +00:00
13100a728f Merge pull request 'Update dependency react-router-dom to ^7.7.0' (#257) from renovate/react-router-dom-7.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-07-17 02:02:04 +00:00
de2fc4a62f Update dependency react-router-dom to ^7.7.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-07-17 00:18:57 +00:00
b5b883df46 Merge pull request 'Update dependency @typescript-eslint/parser to ^8.37.0' (#256) from renovate/typescript-eslint-parser-8.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-07-16 01:41:06 +00:00
285c80926b Update dependency @typescript-eslint/parser to ^8.37.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-07-16 00:18:22 +00:00
a4eb8f3465 Merge pull request 'Update dependency @typescript-eslint/eslint-plugin to ^8.37.0' (#255) from renovate/typescript-eslint-eslint-plugin-8.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-07-15 01:44:36 +00:00
03b1dc1fd7 Update dependency @typescript-eslint/eslint-plugin to ^8.37.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-07-15 00:18:02 +00:00
b55215149f Merge pull request 'Update dependency globals to ^16.3.0' (#254) from renovate/globals-16.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-07-14 01:48:46 +00:00
ad02303a16 Update dependency globals to ^16.3.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-07-14 00:17:54 +00:00
a2de65d454 Merge pull request 'Update dependency eslint to ^9.31.0' (#253) from renovate/eslint-9.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-07-13 01:57:12 +00:00
2d8d1cf28d Update dependency eslint to ^9.31.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-07-13 00:17:47 +00:00
a8dd9fb08c Merge pull request 'Update dependency @vitejs/plugin-react to ^4.6.0' (#252) from renovate/vitejs-plugin-react-4.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-07-12 01:59:06 +00:00
317de38662 Update dependency @vitejs/plugin-react to ^4.6.0
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2025-07-12 00:17:55 +00:00
57f06690c4 Merge pull request 'Update Rust crate clap to 4.5.41' (#251) from renovate/clap-4.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-07-11 01:47:37 +00:00
93554d3719 Update Rust crate clap to 4.5.41
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-07-11 00:18:09 +00:00
56f119008b Merge pull request 'Update dependency @typescript-eslint/parser to ^8.36.0' (#250) from renovate/typescript-eslint-parser-8.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-07-10 02:06:32 +00:00
e1a82e205e Update dependency @typescript-eslint/parser to ^8.36.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-07-10 00:18:52 +00:00
2e3175505f Merge pull request 'Update dependency @typescript-eslint/eslint-plugin to ^8.36.0' (#249) from renovate/typescript-eslint-eslint-plugin-8.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-07-09 01:56:28 +00:00
6108a58919 Update dependency @typescript-eslint/eslint-plugin to ^8.36.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-07-09 00:18:19 +00:00
1e5762bb4f Merge pull request 'Update Rust crate reqwest to 0.12.22' (#248) from renovate/reqwest-0.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-07-08 02:08:49 +00:00
71ecf18a2f Update Rust crate reqwest to 0.12.22
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-07-08 00:18:20 +00:00
a7069fd0ec Merge pull request 'Update dependency react-router-dom to ^7.6.3' (#247) from renovate/react-router-dom-7.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-07-07 01:32:32 +00:00
5d44bb8a21 Update dependency react-router-dom to ^7.6.3
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2025-07-07 00:17:39 +00:00
78da2b181c Merge pull request 'Update dependency @typescript-eslint/parser to ^8.35.1' (#246) from renovate/typescript-eslint-parser-8.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-07-06 01:33:35 +00:00
9e1de0854d Update dependency @typescript-eslint/parser to ^8.35.1
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2025-07-06 00:17:54 +00:00
edb6279b74 Merge pull request 'Update dependency @typescript-eslint/eslint-plugin to ^8.35.1' (#245) from renovate/typescript-eslint-eslint-plugin-8.x into master
All checks were successful
continuous-integration/drone/push Build is passing
2025-07-05 01:48:07 +00:00
fd00a87216 Update dependency @typescript-eslint/eslint-plugin to ^8.35.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-07-05 00:11:36 +00:00
00050c62c5 Update dependency @emotion/styled to ^11.14.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-07-04 00:11:30 +00:00
6824120652 Fix cargo clippy issue
All checks were successful
continuous-integration/drone/push Build is passing
2025-07-03 08:31:07 +02:00
5ed4cc6fed Update dependency @typescript-eslint/parser to ^8.35.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-06-26 00:10:59 +00:00
c805b03370 Update dependency @typescript-eslint/eslint-plugin to ^8.35.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-06-25 00:11:01 +00:00
d97d6bfe56 Update espressif/idf Docker tag to v5.4.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-06-24 00:12:09 +00:00
7151b199f8 Update Rust crate actix-web to 4.11.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-06-23 00:23:26 +00:00
40f938efe7 Update react
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-06-22 00:22:08 +00:00
ffb8c25428 Update dependency globals to ^16.2.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-06-21 00:22:45 +00:00
593719e373 Update dependency eslint to ^9.29.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-06-20 00:23:24 +00:00
13a9905281 Update dependency @vitejs/plugin-react to ^4.5.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-06-19 00:22:21 +00:00
55b354228f Update dependency @typescript-eslint/parser to ^8.34.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-06-18 00:23:41 +00:00
d751ddc671 Update dependency @typescript-eslint/eslint-plugin to ^8.34.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-06-17 00:23:34 +00:00
c5061fdb4d Update dependency vite to ^6.3.5
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-06-16 00:23:53 +00:00
7adbafb831 Update Rust crate reqwest to 0.12.20
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-06-15 00:23:50 +00:00
02397d10f0 Update Rust crate libc to 0.2.173
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-06-14 00:24:08 +00:00
e3ae017279 Update Rust crate openssl-sys to 0.9.109
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-06-13 00:24:13 +00:00
30b5155a4d Update Rust crate openssl to 0.10.73
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-06-12 00:24:51 +00:00
0d04f5d7b2 Update Rust crate clap to 4.5.40
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-06-11 00:25:01 +00:00
a40dff2820 Update dependency react-router-dom to ^7.6.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-06-10 00:24:55 +00:00
6fbec9f0cd Update dependency @fontsource/roboto to ^5.2.6
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-06-09 00:24:18 +00:00
055e512f77 Update dependency @mui/x-date-pickers to ^7.29.4
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-06-07 00:23:55 +00:00
ee769f043f Update Rust crate asn1 to 0.21.3
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-06-06 00:23:39 +00:00
926b265f91 Fix cargo clippy issues
All checks were successful
continuous-integration/drone/push Build is passing
2025-06-05 09:29:36 +00:00
b115ba9307 Update dependency semver to ^7.7.2
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2025-05-15 00:18:20 +00:00
8ada40a5ee Update dependency @typescript-eslint/parser to ^8.32.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-05-14 00:18:57 +00:00
100e42ec6d Update dependency @typescript-eslint/eslint-plugin to ^8.32.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-05-13 00:19:44 +00:00
cab51c9623 Update Rust crate clap to 4.5.38
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-05-12 00:18:49 +00:00
76df0ecf3e Update dependency react-router-dom to ^7.6.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-05-11 00:17:26 +00:00
85cb7d6a75 Update dependency globals to ^16.1.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-05-10 00:18:21 +00:00
69a51e11d3 Update dependency @mui/x-date-pickers to ^7.29.3
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-05-09 00:17:56 +00:00
0ff1d48b90 Update dependency eslint to ^9.26.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-05-08 00:26:57 +00:00
0d478a10f7 Update dependency @typescript-eslint/parser to ^8.32.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-05-07 00:26:51 +00:00
a8e2f2d7bf Update dependency @typescript-eslint/eslint-plugin to ^8.32.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-05-06 00:26:20 +00:00
e961ea0911 Update dependency @vitejs/plugin-react to ^4.4.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-05-05 00:26:15 +00:00
1c1eb53b6e Update dependency @typescript-eslint/parser to ^8.31.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-05-04 00:26:21 +00:00
1a2badc138 Update Rust crate asn1 to 0.21.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-05-03 00:26:12 +00:00
9323a4a3f5 Update dependency @mui/x-date-pickers to ^7.29.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-05-02 00:21:24 +00:00
35cfc73c9d Update Rust crate openssl-sys to 0.9.108
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-05-01 00:21:32 +00:00
dad54c638b Update Rust crate chrono to 0.4.41
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-30 00:21:32 +00:00
4f5be4d08c Update dependency @typescript-eslint/eslint-plugin to ^8.31.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-29 00:21:24 +00:00
b89aee2dcc Update dependency @mui/x-date-pickers to ^7.29.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-28 00:21:12 +00:00
bbe2c3ebc5 Update dependency @mui/x-charts to ^7.29.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-27 00:20:34 +00:00
62037db6e3 Update Rust crate uuid to 1.16.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-26 00:21:16 +00:00
0bf3bdbaea Update Rust crate tokio to 1.44.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-25 00:21:49 +00:00
f65df5f22a Update Rust crate rand to 0.9.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-24 00:21:40 +00:00
406a920d7e Update Rust crate libc to 0.2.172
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-23 00:21:18 +00:00
889ba9b85f Update dependency eslint-plugin-react-refresh to ^0.4.20
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-22 00:29:21 +00:00
12606ba336 Update Rust crate clap to 4.5.37
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-21 00:29:51 +00:00
cb2e17581a Update materialui to ^7.0.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-20 00:29:25 +00:00
4dd5fb4e55 Update dependency typescript to ^5.8.3
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-19 00:30:09 +00:00
0a162e4a78 Update dependency eslint-plugin-react-hooks to ^5.2.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-18 00:29:40 +00:00
ba45faf017 Update Rust crate anyhow to 1.0.98
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-17 00:28:53 +00:00
c4dedb946f Update dependency @mui/x-charts to ^7.28.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-16 00:29:00 +00:00
5004194567 Update dependency @emotion/styled to ^11.14.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-15 00:28:56 +00:00
768f8fc112 Update Rust crate thiserror to 2.0.12
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-14 00:28:53 +00:00
adf1477c4b Update Rust crate serde_json to 1.0.140
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-13 00:29:16 +00:00
7474e25209 Update Rust crate clap to 4.5.36
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-12 00:29:31 +00:00
f33c408c67 Update Rust crate serde to 1.0.219
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-11 00:29:14 +00:00
ccd4125500 Update Rust crate semver to 1.0.26
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-10 00:29:12 +00:00
9825f2628b Update Rust crate rust-embed to 8.6.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-09 00:29:25 +00:00
9e5797e4ca Update Rust crate openssl-sys to 0.9.107
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-08 00:29:26 +00:00
fb562f908c Update Rust crate openssl to 0.10.72
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-07 00:35:20 +00:00
ffb00ee668 Update Rust crate env_logger to 0.11.8
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-06 00:36:29 +00:00
3ad64e55b8 Update Rust crate clap to 4.5.35
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-05 00:36:00 +00:00
f01df2818c Update Rust crate reqwest to 0.12.15
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-04 00:37:23 +00:00
da60a57f53 Update Rust crate openssl-sys to 0.9.106
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-03 00:37:17 +00:00
0629bd60c3 Update Rust crate openssl to 0.10.71
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-02 00:37:48 +00:00
995977fd37 Update Rust crate log to 0.4.27
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-04-01 02:07:52 +00:00
9bf15f28b8 Update Rust crate libc to 0.2.171
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-03-31 20:53:03 +00:00
8941ec2aef Update Rust crate lazy-regex to 3.4.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-03-31 00:37:18 +00:00
b19961ed6a Update Rust crate jsonwebtoken to 9.3.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-03-30 02:23:29 +00:00
082efa367c Update Rust crate anyhow to 1.0.97
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-03-29 22:59:42 +00:00
3ffcdad666 Update Rust crate actix-web to 4.10.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-03-29 18:16:37 +00:00
65db36d097 Update renovate.json
All checks were successful
continuous-integration/drone/push Build is passing
2025-03-29 17:31:13 +00:00
57bb552950 Update node Docker tag to v23
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-03-29 14:14:59 +00:00
1d9c539cd1 Update dependency react-dom to v19.1.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-03-29 12:55:01 +00:00
11d718cfe8 Merge pull request 'Update dependency globals to v16' (#163) from renovate/globals-16.x into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #163
2025-03-29 09:53:17 +00:00
0125b16177 Merge pull request 'Update espressif/idf Docker tag to v5.4.1' (#162) from renovate/espressif-idf-5.x into master
Some checks failed
continuous-integration/drone/push Build was killed
Reviewed-on: #162
2025-03-29 09:52:32 +00:00
d97dcddb96 Merge pull request 'Update dependency react-router-dom to v7.4.1' (#160) from renovate/react-router-dom-7.x-lockfile into master
Some checks failed
continuous-integration/drone/push Build was killed
Reviewed-on: #160
2025-03-29 09:49:43 +00:00
9eafbd8aeb Merge pull request 'Update dependency react to v19.1.0' (#161) from renovate/react-19.x-lockfile into master
Some checks failed
continuous-integration/drone/push Build was killed
Reviewed-on: #161
2025-03-29 09:49:35 +00:00
6aa7fc3a75 Update dependency globals to v16
Some checks failed
continuous-integration/drone/pr Build was killed
continuous-integration/drone/push Build is passing
2025-03-29 09:16:15 +00:00
345b3566ae Update espressif/idf Docker tag to v5.4.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-03-29 09:16:12 +00:00
22cd346330 Update renovate.json
All checks were successful
continuous-integration/drone/push Build is passing
2025-03-29 09:04:45 +00:00
aee9303f91 Update dependency react to v19.1.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-03-29 00:33:23 +00:00
6462645d26 Update dependency react-router-dom to v7.4.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-03-29 00:33:09 +00:00
4bb76777db Update Vite configuration
All checks were successful
continuous-integration/drone/push Build is passing
2025-03-28 20:14:29 +01:00
d79b55b86d Update frontend dependencies
All checks were successful
continuous-integration/drone/push Build is passing
2025-03-28 19:33:30 +01:00
665a04c8a0 Update backend code to Rust Edition 2024
All checks were successful
continuous-integration/drone/push Build is passing
2025-03-28 19:25:15 +01:00
658b10f5f8 Update Espressif to version 5.3.2
All checks were successful
continuous-integration/drone/push Build is passing
2025-03-28 19:17:02 +01:00
c0374e35b1 Update custom consumption dependencies
All checks were successful
continuous-integration/drone/push Build is passing
2025-03-28 19:15:41 +01:00
15f701668f Merge pull request 'Update dependency @mui/x-charts to v7.28.0' (#158) from renovate/mui-x-charts-7.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #158
2025-03-28 15:51:17 +00:00
8fdfa19806 Merge pull request 'Update dependency @typescript-eslint/eslint-plugin to v8.28.0' (#159) from renovate/typescript-eslint-eslint-plugin-8.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #159
2025-03-28 15:51:11 +00:00
22d84e9464 Merge pull request 'Update dependency @types/react to v19.0.12' (#157) from renovate/react-19.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #157
2025-03-28 15:51:02 +00:00
a5c5663390 Update dependency @typescript-eslint/eslint-plugin to v8.28.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-03-25 00:27:41 +00:00
7878fb9686 Update dependency @mui/x-charts to v7.28.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-03-25 00:27:33 +00:00
b24642b10d Update dependency @types/react to v19.0.12
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-03-25 00:27:28 +00:00
ce45d841b2 Update dependency @typescript-eslint/eslint-plugin to v8.20.0
All checks were successful
continuous-integration/drone/push Build is passing
2025-03-24 14:58:06 +00:00
1b4e5eda9d Update dependency @types/react to v19.0.5
All checks were successful
continuous-integration/drone/push Build is passing
2025-03-24 14:51:27 +00:00
bb1917d1b4 Update dependency @mui/x-charts to v7.23.6
All checks were successful
continuous-integration/drone/push Build is passing
2025-03-24 14:44:59 +00:00
b285323bd7 Merge pull request 'Update Rust crate semver to v1.0.26' (#154) from renovate/semver-1.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #154
2025-03-24 14:35:38 +00:00
ecb161ee82 Merge pull request 'Update dependency eslint-plugin-react-hooks to v5.2.0' (#156) from renovate/eslint-plugin-react-hooks-5.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #156
2025-03-24 09:57:39 +00:00
00c6ae338b Merge pull request 'Update Rust crate serde_json to v1.0.140' (#155) from renovate/serde_json-1.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #155
2025-03-24 09:57:27 +00:00
814046146c Update dependency eslint-plugin-react-hooks to v5.2.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-03-12 00:22:31 +00:00
f52e992d84 Merge pull request 'Update Rust crate thiserror to v2.0.11' (#148) from renovate/thiserror-2.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #148
2025-03-11 14:40:20 +00:00
dc73882347 Merge branch 'master' into renovate/thiserror-2.x-lockfile
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-03-11 14:28:40 +00:00
5ed8c42b99 Update Rust crate tokio to v1.43.0
All checks were successful
continuous-integration/drone/push Build is passing
2025-03-11 14:24:46 +00:00
0fcb902e9e Update Rust crate uuid to v1.11.1 (#149)
All checks were successful
continuous-integration/drone/push Build is passing
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [uuid](https://github.com/uuid-rs/uuid) | dependencies | patch | `1.11.0` -> `1.11.1` |

---

### Release Notes

<details>
<summary>uuid-rs/uuid (uuid)</summary>

### [`v1.11.1`](https://github.com/uuid-rs/uuid/releases/tag/1.11.1)

[Compare Source](https://github.com/uuid-rs/uuid/compare/1.11.0...1.11.1)

#### What's Changed

-   Finish cut off docs by [@&#8203;KodrAus](https://github.com/KodrAus) in https://github.com/uuid-rs/uuid/pull/777
-   Fix links in CONTRIBUTING.md by [@&#8203;jacobggman](https://github.com/jacobggman) in https://github.com/uuid-rs/uuid/pull/778
-   Update rust toolchain before building by [@&#8203;KodrAus](https://github.com/KodrAus) in https://github.com/uuid-rs/uuid/pull/781
-   Prepare for 1.11.1 release by [@&#8203;KodrAus](https://github.com/KodrAus) in https://github.com/uuid-rs/uuid/pull/782

#### New Contributors

-   [@&#8203;jacobggman](https://github.com/jacobggman) made their first contribution in https://github.com/uuid-rs/uuid/pull/778

**Full Changelog**: https://github.com/uuid-rs/uuid/compare/1.11.0...1.11.1

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Enabled.

♻ **Rebasing**: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzOS4xMDUuMSIsInVwZGF0ZWRJblZlciI6IjM5LjEwNS4xIiwidGFyZ2V0QnJhbmNoIjoibWFzdGVyIiwibGFiZWxzIjpbXX0=-->

Reviewed-on: #149
2025-03-11 14:09:22 +00:00
cfafbda77b Update Rust crate serde_json to v1.0.140
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-03-04 00:21:07 +00:00
dace42aef2 Update Rust crate semver to v1.0.26
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2025-03-04 00:21:02 +00:00
67401e8faf Fix cargo clippy issue
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-22 19:43:32 +01:00
77a278bd53 Update Rust crate thiserror to v2.0.11
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2025-01-11 00:23:17 +00:00
6df43fcc0e Update Rust crate clap to v4.5.26
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is failing
2025-01-10 00:23:11 +00:00
8add37fc42 Update dependency @types/react to v19.0.4
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-09 01:19:27 +00:00
bfde6531c2 Update Rust crate thiserror to v2.0.10
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-01-09 00:23:10 +00:00
5f6ac7bcfd Update Rust crate serde_json to v1.0.135
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-08 01:25:39 +00:00
c01f1ca484 Update Rust crate clap to v4.5.24
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-01-08 00:28:35 +00:00
c6975c2097 Update dependency @typescript-eslint/eslint-plugin to v8.19.1
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-07 01:00:20 +00:00
2d079403c5 Update dependency @types/react to v19.0.3
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-01-07 00:27:34 +00:00
2d408871ad Update dependency @mui/icons-material to v6.3.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-01-05 00:24:30 +00:00
22fd077380 Update dependency react-dom to v19
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-01-04 00:24:40 +00:00
0fba1caf62 Update dependency react to v19
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-03 00:49:17 +00:00
7e99cfc086 Update dependency vite to v6.0.7
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-01-03 00:23:48 +00:00
511011bb4b Update dependency eslint-plugin-react-hooks to v5.1.0
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-02 00:44:23 +00:00
dfca6a04bc Update dependency @typescript-eslint/parser to v8.19.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-01-02 00:23:46 +00:00
4f639522b9 Update dependency @typescript-eslint/eslint-plugin to v8.19.0
All checks were successful
continuous-integration/drone/push Build is passing
2025-01-01 00:58:34 +00:00
7d9af6af64 Update Rust crate reqwest to v0.12.12
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2025-01-01 00:24:03 +00:00
e1136926a1 Fix condition
All checks were successful
continuous-integration/drone/push Build is passing
2024-12-30 09:29:28 +01:00
4206d9529b Update frontend dependencies
All checks were successful
continuous-integration/drone/push Build is passing
2024-12-30 09:26:00 +01:00
b606aed10e Merge pull request 'Update dependency @typescript-eslint/eslint-plugin to v8.17.0' (#91) from renovate/typescript-eslint-eslint-plugin-8.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #91
2024-12-30 08:18:14 +00:00
9a2ceb9804 Merge pull request 'Update Rust crate zip to v2.2.2' (#115) from renovate/zip-2.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #115
2024-12-30 08:17:33 +00:00
f6bd7b1061 Merge pull request 'Update dependency @mui/icons-material to v6.2.1' (#117) from renovate/mui-icons-material-6.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #117
2024-12-30 08:17:25 +00:00
34460500a0 Update Rust crate thiserror to v2.0.9
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-30 00:23:52 +00:00
72afa3df62 Fix daily runtime calculation
All checks were successful
continuous-integration/drone/push Build is passing
2024-12-29 14:30:32 +01:00
e74f7d6f6d Update Rust crate serde to v1.0.217
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-29 00:23:53 +00:00
5b09aec93a Update Rust crate reqwest to v0.12.11
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-28 00:25:31 +00:00
9f93f76d8e Update Rust crate reqwest to v0.12.10
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-27 00:24:07 +00:00
211369a1b2 Update Rust crate serde_json to v1.0.134
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-26 00:23:33 +00:00
d7c4cd6635 Update Rust crate anyhow to v1.0.95
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-25 00:23:28 +00:00
4f78e99f65 Merge pull request 'Update Rust crate env_logger to v0.11.6' (#121) from renovate/env_logger-0.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #121
2024-12-24 14:32:24 +00:00
4309a19f24 Merge branch 'master' of ssh://gitea.communiquons.org:52001/pierre/SolarEnergy
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2024-12-24 15:30:52 +01:00
67a0436d02 Publish version 1.0.2 of ESP32 firmware 2024-12-24 17:30:17 +01:00
5ff169d8c2 Add a PIN to the card 2024-12-24 17:22:37 +01:00
541f7cbe95 Update Rust crate env_logger to v0.11.6
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-12-21 00:24:34 +00:00
166ac5c8c2 Update Rust crate libc to v0.2.169
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-20 00:24:32 +00:00
0b53037140 Update Rust crate thiserror to v2.0.8
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-19 00:24:17 +00:00
901f6b0e6f Update dependency @typescript-eslint/parser to v8.18.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-18 00:06:47 +00:00
fc5f9735bf Update dependency @mui/icons-material to v6.2.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-12-18 00:06:44 +00:00
094ff457ac Update dependency @types/react to v18.3.17
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-17 00:06:51 +00:00
ffbbd14ac3 Update Rust crate zip to v2.2.2
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-12-17 00:06:49 +00:00
e4447e9dcb Merge pull request 'Update dependency @mui/x-date-pickers to v7.23.2' (#113) from renovate/mui-x-date-pickers-7.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #113
2024-12-16 10:02:32 +00:00
973190f5b9 Merge pull request 'Update Rust crate thiserror to v2.0.7' (#112) from renovate/thiserror-2.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #112
2024-12-16 10:02:23 +00:00
ededf48977 Update dependency @types/react to v18.3.16
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-16 00:07:20 +00:00
9a5211812e Update dependency @mui/x-date-pickers to v7.23.2
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-12-16 00:07:18 +00:00
6f589f3ee4 Update Rust crate thiserror to v2.0.7
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-12-15 00:07:02 +00:00
499c5cb81e Update Rust crate serde to v1.0.216
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-15 00:06:55 +00:00
d72cdbf3cd Update Rust crate semver to v1.0.24
All checks were successful
continuous-integration/drone/push Build is passing
2024-12-14 01:00:58 +00:00
7ab60c6fe6 Update Rust crate libc to v0.2.168
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-14 00:07:52 +00:00
bf28d1c926 Merge pull request 'Update dependency @types/react to v18.3.14' (#99) from renovate/react-18.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #99
2024-12-13 19:34:40 +00:00
07ca3aa80e Merge pull request 'Update dependency @typescript-eslint/parser to v8.18.0' (#105) from renovate/typescript-eslint-parser-8.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #105
2024-12-13 19:32:39 +00:00
4cc18d407d Update dependency @mui/x-charts to v7.23.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-13 00:06:59 +00:00
7bcafd782f Update dependency @mui/icons-material to v6.2.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-12 00:07:06 +00:00
404fa716f5 Update Rust crate chrono to v0.4.39
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-11 00:23:23 +00:00
43bbb444db Update dependency @typescript-eslint/parser to v8.18.0
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-12-10 00:23:35 +00:00
71a139af59 Update dependency @emotion/styled to v11.14.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-10 00:23:32 +00:00
c40b4acf7a Update Rust crate tokio to v1.42.0
All checks were successful
continuous-integration/drone/push Build is passing
2024-12-09 01:13:38 +00:00
41a228484f Update Rust crate thiserror to v2.0.6
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-09 00:23:24 +00:00
9965de686d Update dependency @typescript-eslint/parser to v8.17.0
All checks were successful
continuous-integration/drone/push Build is passing
2024-12-08 01:09:50 +00:00
3cf808df1c Update Rust crate thiserror to v2.0.5
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-08 00:23:40 +00:00
40b41688e0 Update dependency @types/react to v18.3.14
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-12-07 00:27:49 +00:00
124b0b825c Update dependency @mui/x-date-pickers to v7.23.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-07 00:27:47 +00:00
8e4bed012d Update dependency @mui/x-charts to v7.23.1
All checks were successful
continuous-integration/drone/push Build is passing
2024-12-06 01:46:26 +00:00
ff79fd968e Update Rust crate clap to v4.5.23
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-06 00:24:50 +00:00
ac26065f10 Update dependency @mui/icons-material to v6.1.10
All checks were successful
continuous-integration/drone/push Build is passing
2024-12-05 01:42:26 +00:00
b8b172f17d Update Rust crate thiserror to v2.0.4
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-05 00:24:38 +00:00
12fe1abb0f Update Rust crate clap to v4.5.22
All checks were successful
continuous-integration/drone/push Build is passing
2024-12-04 02:02:13 +00:00
acfacf574b Update Rust crate anyhow to v1.0.94
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-04 00:25:19 +00:00
d0e426bbbc Fix cargo clippy issue
All checks were successful
continuous-integration/drone/push Build is passing
2024-12-03 22:44:53 +01:00
92a9a5741c Fix cargo clippy issue
Some checks failed
continuous-integration/drone/push Build was killed
2024-12-03 22:40:57 +01:00
9a480dfa98 Merge pull request 'Update dependency @vitejs/plugin-react to v4.3.4' (#81) from renovate/vitejs-plugin-react-4.x-lockfile into master
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #81
2024-12-03 20:53:10 +00:00
f8eafe31bd Merge pull request 'Update dependency typescript to v5.7.2' (#76) from renovate/typescript-5.x-lockfile into master
Some checks failed
continuous-integration/drone/push Build is failing
Reviewed-on: #76
2024-12-03 20:52:53 +00:00
4330e64489 Update dependency @typescript-eslint/eslint-plugin to v8.17.0
Some checks failed
continuous-integration/drone/push Build is failing
continuous-integration/drone/pr Build is failing
2024-12-03 00:23:08 +00:00
fd5730cfce Update dependency eslint-plugin-react-refresh to v0.4.16
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is failing
2024-12-03 00:23:05 +00:00
76acf07b17 Update dependency eslint to v9.16.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-02 00:23:04 +00:00
315e11a2bb Update dependency @mui/x-date-pickers to v7.23.0
All checks were successful
continuous-integration/drone/push Build is passing
2024-12-01 00:38:35 +00:00
5722ccc2c4 Update Rust crate fs4 to 0.12.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-12-01 00:22:55 +00:00
71718151d0 Update dependency @mui/x-charts to v7.23.0
All checks were successful
continuous-integration/drone/push Build is passing
2024-11-30 00:53:31 +00:00
9efd8db8cf Update Rust crate libc to v0.2.167
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-30 00:23:15 +00:00
fc0c86bf8b Update dependency @typescript-eslint/parser to v8.16.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-29 00:23:44 +00:00
1a8c3ff9ff Update dependency @mui/icons-material to v6.1.9
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-28 00:17:58 +00:00
4cb05b375e Update dependency @vitejs/plugin-react to v4.3.4
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-11-27 00:18:10 +00:00
f67ccc7cda Update Rust crate libc to v0.2.166
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-27 00:18:05 +00:00
8a08ff53df Update dependency @typescript-eslint/eslint-plugin to v8.16.0
All checks were successful
continuous-integration/drone/push Build is passing
2024-11-26 00:37:12 +00:00
2607ac7355 Update Rust crate libc to v0.2.165
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-26 00:17:23 +00:00
e644aa1390 Update dependency react-router-dom to v7
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-25 00:17:22 +00:00
e015f01539 Update dependency typescript to v5.7.2
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-11-24 00:18:03 +00:00
37aed38174 Update Rust crate asn1 to 0.20
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-24 00:18:00 +00:00
aa3677a787 Update dependency @mui/x-date-pickers to v7.22.3
All checks were successful
continuous-integration/drone/push Build is passing
2024-11-23 00:57:25 +00:00
549193632c Update dependency @mui/x-charts to v7.22.3
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-23 00:17:54 +00:00
407aeaaf6e Update dependency @mui/icons-material to v6.1.8
All checks were successful
continuous-integration/drone/push Build is passing
2024-11-22 01:09:21 +00:00
36d269dde7 Update Rust crate zip to v2.2.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-22 00:18:05 +00:00
0c4f352815 Update dependency @emotion/styled to v11.13.5
All checks were successful
continuous-integration/drone/push Build is passing
2024-11-21 00:47:05 +00:00
e1abc68292 Update dependency @emotion/react to v11.13.5
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-21 00:17:10 +00:00
bb0226577d Can download a copy of storage
Some checks failed
continuous-integration/drone/push Build is failing
2024-11-19 20:40:49 +01:00
9fcd16784a Fix issue with time widget
All checks were successful
continuous-integration/drone/push Build is passing
2024-11-19 19:05:46 +01:00
d6e0eccb00 Make dashboard titles customizable
All checks were successful
continuous-integration/drone/push Build is passing
2024-11-19 19:02:09 +01:00
dc621984fb Replace device id with device name 2024-11-19 18:50:57 +01:00
b2878510d6 Update project dependencies
All checks were successful
continuous-integration/drone/push Build is passing
2024-11-19 18:48:49 +01:00
a059076323 Update dependency @typescript-eslint/parser to v8.15.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-19 00:07:02 +00:00
f594802523 Update Rust crate serde_json to v1.0.133
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-18 00:07:29 +00:00
747d2d819b Update Rust crate libc to v0.2.164
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-17 00:07:19 +00:00
a52868a3fb Update dependency eslint to v9.15.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-16 00:06:36 +00:00
fce38386eb Update dependency @mui/icons-material to v6.1.7
All checks were successful
continuous-integration/drone/push Build is passing
2024-11-14 00:33:35 +00:00
cb88a19352 Update Rust crate clap to v4.5.21
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-14 00:07:10 +00:00
c6c34efebd Update dependency @typescript-eslint/parser to v8.14.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-13 00:06:50 +00:00
eed9637f1e Update dependency vite to v5.4.11
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-12 00:06:59 +00:00
3a64b2b09c Update Rust crate thiserror to v1.0.69
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-11 00:26:36 +00:00
8d2f0cb38a Update dependency @mui/x-date-pickers to v7.22.2
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-10 00:27:24 +00:00
5b1cf61832 Update dependency @mui/x-charts to v7.22.2
All checks were successful
continuous-integration/drone/push Build is passing
2024-11-09 00:32:48 +00:00
6cd5d5f93a Update Rust crate tokio to v1.41.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-09 00:15:02 +00:00
fc409b2584 Update Rust crate libc to v0.2.162
All checks were successful
continuous-integration/drone/push Build is passing
2024-11-08 00:51:22 +00:00
5a1942cb15 Update Rust crate fs4 to v0.11.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-08 00:15:21 +00:00
4af8904294 Update dependency react-router-dom to v6.28.0
All checks were successful
continuous-integration/drone/push Build is passing
2024-11-07 00:53:32 +00:00
0d1605169d Update Rust crate anyhow to v1.0.93
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-07 00:16:21 +00:00
346ea8db11 Update dependency @typescript-eslint/parser to v8.13.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-06 00:15:07 +00:00
f534a9c61b Update Rust crate fs4 to 0.11.0
All checks were successful
continuous-integration/drone/push Build is passing
2024-11-05 00:52:27 +00:00
2ef056da30 Update Rust crate thiserror to v1.0.68
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-05 00:15:18 +00:00
af16091fab Update Rust crate thiserror to v1.0.67
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-04 00:14:58 +00:00
28f81248bf Update dependency eslint to v9.14.0
All checks were successful
continuous-integration/drone/push Build is passing
2024-11-03 00:25:54 +00:00
cc43f6c78b Update dependency @mui/x-date-pickers to v7.22.1
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-03 00:14:50 +00:00
060ff08c1e Update dependency @mui/x-charts to v7.22.1
All checks were successful
continuous-integration/drone/push Build is passing
2024-11-02 00:46:08 +00:00
57ce643163 Update Rust crate anyhow to v1.0.92
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-02 00:21:39 +00:00
7a536ac850 Update dependency @typescript-eslint/parser to v8.12.2
All checks were successful
continuous-integration/drone/push Build is passing
2024-11-01 01:06:00 +00:00
685eef5c5b Update Rust crate thiserror to v1.0.66
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-11-01 00:34:46 +00:00
180126d22a Update dependency @mui/icons-material to v6.1.6
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-31 00:35:20 +00:00
e29f01bc62 Update Rust crate serde to v1.0.214
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-29 01:19:38 +00:00
f2abdfe302 Update Rust crate reqwest to v0.12.9
Some checks failed
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is failing
2024-10-29 00:29:11 +00:00
598286d1cb Update dependency eslint to v9
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-28 00:47:57 +00:00
30f196aa7a Update dependency @mui/x-date-pickers to v7.22.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-28 00:28:15 +00:00
08f1ec6d4d Update dependency @mui/x-charts to v7.22.0
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-27 00:29:50 +00:00
d31a568c00 Update Rust crate tokio to v1.41.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-27 00:09:30 +00:00
1b25c07e50 Update Rust crate asn1 to 0.18
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-26 00:35:18 +00:00
96f1640378 Update dependency vite to v5.4.10
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-26 00:09:57 +00:00
ccb4ae22f8 Update dependency eslint-plugin-react-refresh to v0.4.14
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-25 00:34:13 +00:00
d66e2b9bf7 Update dependency @types/react to v18.3.12
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-25 00:10:07 +00:00
0660066941 Update dependency @mui/icons-material to v6.1.5
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-24 00:56:09 +00:00
7476924e0e Update Rust crate thiserror to v1.0.65
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-24 00:10:25 +00:00
65c3c534f4 Update Rust crate serde to v1.0.213
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-23 01:24:18 +00:00
995e1fa07e Update Rust crate anyhow to v1.0.91
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-23 00:10:16 +00:00
1735077db3 Update dependency @typescript-eslint/parser to v8.11.0
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-22 00:57:31 +00:00
31bb956a29 Update dependency @typescript-eslint/eslint-plugin to v8.11.0
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-22 00:20:52 +00:00
ff0e548422 Update dependency eslint-plugin-react-refresh to v0.4.13
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-21 00:20:07 +00:00
837835da7e Update dependency @vitejs/plugin-react to v4.3.3
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-20 01:25:13 +00:00
2d262bb4c9 Update Rust crate serde_json to v1.0.132
Some checks failed
continuous-integration/drone/pr Build is failing
continuous-integration/drone/push Build is passing
2024-10-20 00:20:54 +00:00
f594ebfbaa Don't block home widget if live consumption is unavailable
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-19 15:49:10 +02:00
57a9c03308 Add more flexibility when fetching production value 2024-10-19 15:39:30 +02:00
7b9db9c7c3 Merge branch 'master' of ssh://gitea.communiquons.org:52001/pierre/SolarEnergy
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-19 13:32:14 +02:00
b7720df305 Assign version to backend
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-19 15:32:38 +02:00
445c1b014e Start to work on new version 2024-10-19 15:23:21 +02:00
aa732af571 Update to version 1.0.1 2024-10-19 14:16:27 +02:00
c365f959e7 Change backend hostname 2024-10-19 13:54:25 +02:00
9a4c6d2de2 Update project dependencies 2024-10-19 13:21:10 +02:00
3c20cca915 Update prod documentation 2024-10-19 11:41:21 +02:00
5aaad54de3 Merge branch 'master' of ssh://gitea.communiquons.org:52001/pierre/SolarEnergy
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2024-10-19 09:25:48 +02:00
b3edfb05d9 Update Rust crate anyhow to v1.0.90
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-19 00:29:11 +00:00
45029f24cc Can use cURL to request fronius production 2024-10-18 21:18:00 +02:00
ec594c0e4d Fix typo
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-18 20:53:50 +02:00
fdfbdf093f Create production installation guide
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-18 20:41:08 +02:00
c789056ccf Improve env var name
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2024-10-18 20:05:40 +02:00
f5f783698f Add support for environment files
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2024-10-18 19:57:06 +02:00
823783f307 Update ESP-IDF to version 5.3.1
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/tag Build is passing
2024-10-18 19:40:27 +02:00
187a8b3657 Merge branch 'master' of ssh://gitea.communiquons.org:52001/pierre/SolarEnergy
Some checks failed
continuous-integration/drone/push Build is failing
2024-10-18 18:17:28 +02:00
2c300109a3 Update Rust crate serde_json to v1.0.129
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-18 01:42:35 +00:00
6528de4a9e Update Rust crate libc to v0.2.161
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-18 00:28:57 +00:00
7846b093da Merge pull request 'Update Rust crate openssl-sys to v0.9.104' (#10) from renovate/openssl-sys-0.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #10
2024-10-17 06:44:32 +00:00
a2acbb53b0 Update Rust crate openssl-sys to v0.9.104
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-10-17 00:28:24 +00:00
9fd87b6452 Update Rust crate openssl to v0.10.68
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-17 00:28:19 +00:00
e151b50efa Update dependency @mui/icons-material to v6.1.4
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-16 00:28:18 +00:00
20abc120b5 Remove default README
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-15 22:49:33 +02:00
540d10bf78 Add README and start to work on build for prod guide
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-15 22:48:26 +02:00
f8bcb63513 Add license
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-15 22:29:26 +02:00
f920c4d9fa Merge pull request 'Update dependency vite to v5.4.9' (#6) from renovate/vite-5.x-lockfile into master
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #6
2024-10-15 20:28:18 +00:00
26bb6647b2 Update dependency vite to v5.4.9
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
2024-10-15 00:28:02 +00:00
8e1c2bc8bd Update Rust crate clap to v4.5.20
All checks were successful
continuous-integration/drone/pr Build is passing
continuous-integration/drone/push Build is passing
2024-10-15 00:27:54 +00:00
16b03f0a05 Add documentation to setup dev env
All checks were successful
continuous-integration/drone/push Build is passing
2024-10-14 23:07:06 +02:00
e1b5f2f282 Configure Renovate (#1)
All checks were successful
continuous-integration/drone/push Build is passing
Enable Renovate for the project
2024-10-14 20:43:29 +00:00
8a2ac0c434 Enable CI (#4)
All checks were successful
continuous-integration/drone/push Build is passing
Reviewed-on: #4
2024-10-14 20:42:20 +00:00
ebb4f8bdd2 Update dependencies 2024-10-14 22:14:55 +02:00
be77e7cb04 Upgraded ESP-IDF to version 5.3.1 2024-10-13 12:39:29 +02:00
13f8b5a592 Add support for legacy relays API 2024-10-12 20:53:23 +02:00
5408cd3a9c Can get consumption on Fronius inverter 2024-10-12 17:28:49 +02:00
784fe58c3e Display a message if no OTA update have been uploaded 2024-10-12 16:44:02 +02:00
5857892a4b Handle non-existent OTA storage directories 2024-10-12 16:42:01 +02:00
2f8b8aa59f Display a message if relays list is empty 2024-10-12 15:24:40 +02:00
e244fff700 Remove useless linebreaks in log messages 2024-10-12 17:02:39 +02:00
cbca7c8f4c OTA procedure is functional 2024-10-12 16:56:58 +02:00
521ccc899a Ready to implement OTA logic 2024-10-12 16:30:53 +02:00
a088ddc5b8 Determine firmware download URL 2024-10-12 16:10:07 +02:00
7e12e0df00 Update frontend dependencies 2024-10-12 15:51:03 +02:00
d90d033e74 Merge branch 'master' of http://10.0.0.10/pierre/SolarEnergy 2024-10-12 15:39:05 +02:00
e7190bab71 Make OTA update live 2024-10-09 18:46:51 +02:00
386f0439e4 Create the dialog to select the deployment target 2024-10-09 18:32:29 +02:00
e4da44b5ce Add a button to refresh the list of updates 2024-10-08 22:27:23 +02:00
138dd6c6b8 Minor improvments 2024-10-08 22:24:00 +02:00
eafa8e6a4b Can delete an OTA update 2024-10-08 22:22:57 +02:00
2e4a2b68dd Can manually download an OTA update 2024-10-08 22:13:36 +02:00
6cf7c2cae1 Display the list of OTA updates in the frontend 2024-10-08 21:53:21 +02:00
2924d14281 Firmware upload is functional 2024-10-07 22:13:47 +02:00
cef5b5aa5b Created form to upload new firmware 2024-10-07 22:04:57 +02:00
42f459f88b WIP OTA implementation 2024-10-05 20:39:05 +02:00
f4dda44d15 Prepare OTA execution 2024-10-05 20:28:55 +02:00
80452e10de Decode firmware update information 2024-10-05 20:13:36 +02:00
aa262879f0 Add route to download firmware on device 2024-10-05 20:00:57 +02:00
37844ae5fa Notify devices of available updates through sync endpoint 2024-10-05 19:44:32 +02:00
d38040cb98 Get the list of OTA updates for a given platform 2024-10-05 19:35:23 +02:00
2feb3f6490 Can set device desired version 2024-10-05 16:26:07 +02:00
2f971c0055 Add a route to upload update to the platform 2024-10-05 15:50:46 +02:00
e1a94acdcb Add a route to get the list of supported platforms for OTA 2024-10-05 13:03:30 +02:00
382c44a18a Let ESP IDF manage app version 2024-10-05 12:03:35 +02:00
17f8931f0f Enable logs reporting 2024-10-05 11:47:41 +02:00
cc63906ec1 Update frontend dependencies 2024-10-05 11:27:21 +02:00
59f8b59efe Merge branch 'master' of http://10.0.0.10/pierre/SolarEnergy 2024-10-05 11:11:23 +02:00
06659404c1 Prepare the path for OTA implementation 2024-10-03 21:16:51 +02:00
436bcd5677 Reverse display order of log messages 2024-10-03 21:01:38 +02:00
caf05d9126 Display log events 2024-10-03 20:52:05 +02:00
7dfb172aeb Frontend requests log on backend 2024-10-02 21:54:54 +02:00
75753051f9 Add function to extract logs 2024-10-01 22:27:34 +02:00
63bdeed952 Add function to report devices activity 2024-09-30 22:12:06 +02:00
7f952700ad Update sdkconfig for OTA 2024-09-29 18:33:41 +02:00
5608b4e610 Add ESP32 pinout 2024-09-28 21:14:09 +02:00
b4220a3254 Avoid bad relay trigger on startup 2024-09-28 20:33:11 +02:00
4d07d83904 Start to work on GPIOs 2024-09-28 20:27:12 +02:00
274b7089d1 Ready to implement GPIO logic to manage relays 2024-09-28 20:02:34 +02:00
e574bed96f Fix a memory leak 2024-09-28 16:42:10 +02:00
ce8427b0aa Handle fails more properly 2024-09-28 16:35:50 +02:00
58abf4ec9b Parse sync response from server 2024-09-28 16:35:05 +02:00
5704f2b57f Fix frontend images path 2024-09-28 11:40:29 +02:00
51fc7cc710 Update frontend dependencies 2024-09-28 11:32:43 +02:00
b800b90337 Merge branch 'master' of ssh://gitea.communiquons.org:52001/pierre/SolarEnergy 2024-09-28 09:22:52 +02:00
b5acda292d Sign JWT 2024-09-27 21:28:05 +02:00
77c3702986 Ready to implement JWT signature 2024-09-27 20:13:50 +02:00
7f9db9f2cc Improve home page 2024-09-26 23:21:56 +02:00
cb798dfd14 Enrich home page 2024-09-26 23:14:18 +02:00
3f41269c0b Use medians 2024-09-26 23:05:10 +02:00
7895b9eca8 Display relay consumption history 2024-09-26 22:51:43 +02:00
903f1fa8ce Show current consumption chart 2024-09-26 22:37:43 +02:00
2e72634abf Can request consumption history 2024-09-25 22:31:00 +02:00
821b4644a2 Minor refacto 2024-09-25 22:00:36 +02:00
e0f0067e89 Get state of relay on device page 2024-09-25 21:56:54 +02:00
3c2fa18d9a Display relays status 2024-09-25 19:35:39 +02:00
131 changed files with 10119 additions and 4055 deletions

105
.drone.yml Normal file
View File

@@ -0,0 +1,105 @@
---
kind: pipeline
type: docker
name: default
steps:
- name: web_build
image: node:23
volumes:
- name: web_app
path: /tmp/web_build
commands:
- cd central_frontend
- npm install
- npm run build
- mv dist /tmp/web_build
- name: backend_check
image: rust
volumes:
- name: rust_registry
path: /usr/local/cargo/registry
commands:
- rustup component add clippy
- cd central_backend
- cargo clippy -- -D warnings
- cargo test
- name: custom_consumption_check
image: rust
volumes:
- name: rust_registry
path: /usr/local/cargo/registry
commands:
- rustup component add clippy
- cd custom_consumption
- cargo clippy -- -D warnings
- cargo test
depends_on:
- backend_check
- name: backend_compile
image: rust
volumes:
- name: rust_registry
path: /usr/local/cargo/registry
- name: web_app
path: /tmp/web_build
- name: releases
path: /tmp/releases
when:
event:
- tag
depends_on:
- backend_check
- web_build
commands:
- cd central_backend
- mv /tmp/web_build/dist static
- cargo build --release
- ls -lah target/release/central_backend
- mv target/release/central_backend /tmp/releases/central_backend
# Build ESP32 program
- name: esp32_compile
image: espressif/idf:v5.5.1
volumes:
- name: releases
path: /tmp/releases
commands:
- cd esp32_device
- /opt/esp/entrypoint.sh idf.py build
- ls -lah build/main.bin
- cp build/main.bin /tmp/releases/wt32-eth01.bin
# Auto-release to Gitea
- name: gitea_release
image: plugins/gitea-release
depends_on:
- backend_compile
- esp32_compile
when:
event:
- tag
volumes:
- name: releases
path: /tmp/releases
environment:
PLUGIN_API_KEY:
from_secret: GITEA_API_KEY # needs permission write:repository
settings:
base_url: https://gitea.communiquons.org
files:
- /tmp/releases/central_backend
- /tmp/releases/wt32-eth01.bin
checksum: sha512
volumes:
- name: rust_registry
temp: {}
- name: web_app
temp: {}
- name: releases
temp: {}

675
LICENSE Normal file
View File

@@ -0,0 +1,675 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <https://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<https://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<https://www.gnu.org/licenses/why-not-lgpl.html>.

View File

@@ -1,2 +1,18 @@
# SolarEnergy # SolarEnergy
WIP project A project to optimize solar energy production and consumption. It connect to a current meter to decides whether some appliances controlled by relays shall be turned on or not, based on criterias such as:
* Minimal uptime
* Minimal downtime
* Daily minimal runtime
* Estimated consumption
* Dependencies, conflicts
## Components
* [`central_backend`](./central_backend): The core component that connects all the other one and make the decisions to turn on or off devices
* [`central_frontend`](./central_frontend): Web UI to configure the devices and monitor them
* [`custom_consumtion`](./custom_consumption): Development tool used to test different production values
* [`esp32_device`](./esp32_device/): The code installed in the MCU that controls relays (Wt32-Eth01 devices)
* [`python_device`](./python_device/): An alternative to the esp32 to control relays. Not production ready.
## Documentation
* [Setup for development](./docs/SETUP_DEV.md) guide
* [Setup for production](./docs/SETUP_PROD.md) guide

File diff suppressed because it is too large Load Diff

View File

@@ -1,41 +1,46 @@
[package] [package]
name = "central_backend" name = "central_backend"
version = "0.1.0" version = "1.0.3"
edition = "2021" edition = "2024"
[dependencies] [dependencies]
log = "0.4.22" log = "0.4.28"
env_logger = "0.11.5" env_logger = "0.11.8"
lazy_static = "1.5.0" lazy_static = "1.5.0"
clap = { version = "4.5.18", features = ["derive", "env"] } dotenvy = "0.15.7"
anyhow = "1.0.89" clap = { version = "4.5.53", features = ["derive", "env"] }
thiserror = "1.0.63" anyhow = "1.0.100"
openssl = { version = "0.10.66" } thiserror = "2.0.17"
openssl-sys = "0.9.102" openssl = { version = "0.10.75" }
libc = "0.2.158" openssl-sys = "0.9.111"
libc = "0.2.177"
foreign-types-shared = "0.1.1" foreign-types-shared = "0.1.1"
asn1 = "0.17" asn1 = "0.23.0"
actix-web = { version = "4", features = ["openssl"] } actix-web = { version = "4.11.0", features = ["openssl"] }
futures = "0.3.30" futures = "0.3.31"
serde = { version = "1.0.210", features = ["derive"] } serde = { version = "1.0.228", features = ["derive"] }
reqwest = "0.12.7" reqwest = { version = "0.12.24", features = ["json"] }
serde_json = "1.0.128" serde_json = "1.0.145"
rand = "0.8.5" rand = "0.10.0-rc.5"
actix = "0.13.5" actix = "0.13.5"
actix-identity = "0.8.0" actix-identity = "0.9.0"
actix-session = { version = "0.10.1", features = ["cookie-session"] } actix-session = { version = "0.11.0", features = ["cookie-session"] }
actix-cors = "0.7.0" actix-cors = "0.7.1"
actix-multipart = { version = "0.7.2", features = ["derive"] }
actix-remote-ip = "0.1.0" actix-remote-ip = "0.1.0"
futures-util = "0.3.30" futures-util = "0.3.31"
uuid = { version = "1.10.0", features = ["v4", "serde"] } uuid = { version = "1.18.1", features = ["v4", "serde"] }
semver = { version = "1.0.23", features = ["serde"] } semver = { version = "1.0.27", features = ["serde"] }
lazy-regex = "3.3.0" lazy-regex = "3.4.2"
tokio = { version = "1.40.0", features = ["full"] } tokio = { version = "1.48.0", features = ["full"] }
tokio_schedule = "0.3.2" tokio_schedule = "0.3.2"
mime_guess = "2.0.5" mime_guess = "2.0.5"
rust-embed = "8.5.0" rust-embed = "8.8.0"
jsonwebtoken = { version = "9.3.0", features = ["use_pem"] } jsonwebtoken = { version = "10.2.0", features = ["use_pem", "rust_crypto"] }
prettytable-rs = "0.10.0" prettytable-rs = "0.10.0"
chrono = "0.4.38" chrono = "0.4.42"
serde_yml = "0.0.12" serde_yml = "0.0.12"
bincode = "=2.0.0-rc.3" bincode = "2.0.1"
fs4 = { version = "0.13.1", features = ["sync"] }
zip = { version = "6.0.0", features = ["bzip2"] }
walkdir = "2.5.0"

View File

@@ -0,0 +1,33 @@
devices:
- id: dev1
info:
reference: A
version: 0.0.1
max_relays: 1
time_create: 1
time_update: 1
name: Dev1
description: Day1
validated: true
enabled: true
relays:
- id: dcb3fd91-bf9b-4de3-99e5-92c1c7dd72e9
name: R1
enabled: true
priority: 1
consumption: 100
minimal_uptime: 10
minimal_downtime: 10
depends_on: []
conflicts_with: []
on: false
for: 5000
forced_state:
type: Off
for_secs: 500
should_be_on: false
online: true
curr_consumption: -10000

View File

@@ -0,0 +1,49 @@
devices:
- id: dev1
info:
reference: A
version: 0.0.1
max_relays: 1
time_create: 1
time_update: 1
name: Dev1
description: Day1
validated: true
enabled: true
relays:
- id: dcb3fd91-bf9b-4de3-99e5-92c1c7dd72e9
name: R1
enabled: true
priority: 1
consumption: 100
minimal_uptime: 10
minimal_downtime: 10
depends_on: []
conflicts_with: []
on: false
for: 500
forced_state:
type: On
for_secs: 500
should_be_on: true
- id: dcb3fd91-bf9b-4de3-99e5-92c1c7dd72f0
name: R2
enabled: true
priority: 1
consumption: 100
minimal_uptime: 10
minimal_downtime: 10
depends_on: [ ]
conflicts_with: [ ]
on: false
for: 500
forced_state:
type: None
should_be_on: false
online: true
curr_consumption: 10000

View File

@@ -1,4 +1,5 @@
use crate::devices::device::{DeviceId, DeviceRelayID}; use crate::devices::device::{DeviceId, DeviceRelayID};
use crate::ota::ota_update::OTAPlatform;
use clap::{Parser, Subcommand}; use clap::{Parser, Subcommand};
use std::path::{Path, PathBuf}; use std::path::{Path, PathBuf};
@@ -9,7 +10,7 @@ pub enum ConsumptionHistoryType {
} }
/// Electrical consumption fetcher backend /// Electrical consumption fetcher backend
#[derive(Subcommand, Debug, Clone)] #[derive(Subcommand, Debug, Clone, serde::Serialize)]
pub enum ConsumptionBackend { pub enum ConsumptionBackend {
/// Constant consumption value /// Constant consumption value
Constant { Constant {
@@ -34,12 +35,27 @@ pub enum ConsumptionBackend {
#[clap(short, long, default_value = "/dev/shm/consumption.txt")] #[clap(short, long, default_value = "/dev/shm/consumption.txt")]
path: String, path: String,
}, },
/// Fronius inverter consumption
Fronius {
/// The origin of the domain where the webserver of the Fronius Symo can be reached
#[clap(short, long, env)]
fronius_orig: String,
/// Use cURL instead of reqwest to perform request
#[clap(short, long)]
curl: bool,
},
} }
/// Solar system central backend /// Solar system central backend
#[derive(Parser, Debug)] #[derive(Parser, Debug, serde::Serialize)]
#[command(version, about, long_about = None)] #[command(version, about, long_about = None)]
pub struct AppConfig { pub struct AppConfig {
/// Read arguments from env file
#[clap(short, long, env)]
pub config: Option<String>,
/// Proxy IP, might end with a star "*" /// Proxy IP, might end with a star "*"
#[clap(short, long, env)] #[clap(short, long, env)]
pub proxy_ip: Option<String>, pub proxy_ip: Option<String>,
@@ -94,6 +110,18 @@ pub struct AppConfig {
#[arg(short('f'), long, env, default_value_t = 5)] #[arg(short('f'), long, env, default_value_t = 5)]
pub energy_fetch_interval: u64, pub energy_fetch_interval: u64,
/// Custom current consumption title in dashboard
#[arg(long, env)]
pub dashboard_custom_current_consumption_title: Option<String>,
/// Custom relays consumption title in dashboard
#[arg(long, env)]
pub dashboard_custom_relays_consumption_title: Option<String>,
/// Custom cached consumption title in dashboard
#[arg(long, env)]
pub dashboard_custom_cached_consumption_title: Option<String>,
/// Consumption backend provider /// Consumption backend provider
#[clap(subcommand)] #[clap(subcommand)]
pub consumption_backend: Option<ConsumptionBackend>, pub consumption_backend: Option<ConsumptionBackend>,
@@ -106,6 +134,21 @@ lazy_static::lazy_static! {
} }
impl AppConfig { impl AppConfig {
/// Parse environment variables from file, if requedst
pub fn parse_env_file() -> anyhow::Result<()> {
if let Some(c) = Self::parse().config {
log::info!("Load additional environment variables from {c}");
let conf_file = Path::new(&c);
if !conf_file.is_file() {
panic!("Specified configuration is not a file!");
}
dotenvy::from_path(conf_file)?;
}
Ok(())
}
/// Get parsed command line arguments /// Get parsed command line arguments
pub fn get() -> &'static AppConfig { pub fn get() -> &'static AppConfig {
&ARGS &ARGS
@@ -283,6 +326,31 @@ impl AppConfig {
} }
)) ))
} }
/// Get logs directory
pub fn logs_dir(&self) -> PathBuf {
self.storage_path().join("logs")
}
/// Get the logs for a given day
pub fn log_of_day(&self, day: u64) -> PathBuf {
self.logs_dir().join(format!("{day}.log"))
}
/// Get the directory that will store OTA updates
pub fn ota_dir(&self) -> PathBuf {
self.storage_path().join("ota")
}
/// Get the directory that will store OTA updates for a given platform
pub fn ota_platform_dir(&self, platform: OTAPlatform) -> PathBuf {
self.ota_dir().join(platform.to_string())
}
/// Get the path to the file that will contain an OTA update
pub fn path_ota_update(&self, platform: OTAPlatform, version: &semver::Version) -> PathBuf {
self.ota_platform_dir(platform).join(version.to_string())
}
} }
#[cfg(test)] #[cfg(test)]

View File

@@ -13,6 +13,9 @@ pub const MAX_INACTIVITY_DURATION: u64 = 3600;
/// Maximum session duration (1 day) /// Maximum session duration (1 day)
pub const MAX_SESSION_DURATION: u64 = 3600 * 24; pub const MAX_SESSION_DURATION: u64 = 3600 * 24;
/// Maximum firmware size (in bytes)
pub const MAX_FIRMWARE_SIZE: usize = 50 * 1000 * 1000;
/// List of routes that do not require authentication /// List of routes that do not require authentication
pub const ROUTES_WITHOUT_AUTH: [&str; 2] = pub const ROUTES_WITHOUT_AUTH: [&str; 2] =
["/web_api/server/config", "/web_api/auth/password_auth"]; ["/web_api/server/config", "/web_api/auth/password_auth"];

View File

@@ -16,11 +16,13 @@ impl CRLDistributionPointExt {
let crl_bytes = asn1::write(|w| { let crl_bytes = asn1::write(|w| {
w.write_element(&asn1::SequenceWriter::new(&|w| { w.write_element(&asn1::SequenceWriter::new(&|w| {
w.write_element(&asn1::SequenceWriter::new(&|w| { w.write_element(&asn1::SequenceWriter::new(&|w| {
w.write_tlv(tag_a0, |w| { w.write_tlv(tag_a0, None, |w: &mut asn1::WriteBuf| {
w.push_slice(&asn1::write(|w| { w.push_slice(&asn1::write(|w| {
w.write_tlv(tag_a0, |w| { w.write_tlv(tag_a0, None, |w: &mut asn1::WriteBuf| {
w.push_slice(&asn1::write(|w| { w.push_slice(&asn1::write(|w| {
w.write_tlv(tag_86, |b| b.push_slice(self.url.as_bytes()))?; w.write_tlv(tag_86, None, |b| {
b.push_slice(self.url.as_bytes())
})?;
Ok(()) Ok(())
})?) })?)
})?; })?;

View File

@@ -13,10 +13,10 @@ use openssl::pkey::{PKey, Private};
use openssl::x509::extension::{ use openssl::x509::extension::{
BasicConstraints, ExtendedKeyUsage, KeyUsage, SubjectAlternativeName, SubjectKeyIdentifier, BasicConstraints, ExtendedKeyUsage, KeyUsage, SubjectAlternativeName, SubjectKeyIdentifier,
}; };
use openssl::x509::{CrlStatus, X509Crl, X509Name, X509NameBuilder, X509Req, X509}; use openssl::x509::{CrlStatus, X509, X509Crl, X509Name, X509NameBuilder, X509Req};
use openssl_sys::{ use openssl_sys::{
X509_CRL_add0_revoked, X509_CRL_new, X509_CRL_set1_lastUpdate, X509_CRL_set1_nextUpdate, X509_CRL_add0_revoked, X509_CRL_new, X509_CRL_set_issuer_name, X509_CRL_set_version,
X509_CRL_set_issuer_name, X509_CRL_set_version, X509_CRL_sign, X509_REVOKED_dup, X509_CRL_set1_lastUpdate, X509_CRL_set1_nextUpdate, X509_CRL_sign, X509_REVOKED_dup,
X509_REVOKED_new, X509_REVOKED_set_revocationDate, X509_REVOKED_set_serialNumber, X509_REVOKED_new, X509_REVOKED_set_revocationDate, X509_REVOKED_set_serialNumber,
}; };
@@ -120,7 +120,7 @@ enum GenCertificatSubjectReq<'a> {
CSR { csr: &'a X509Req }, CSR { csr: &'a X509Req },
} }
impl<'a> Default for GenCertificatSubjectReq<'a> { impl Default for GenCertificatSubjectReq<'_> {
fn default() -> Self { fn default() -> Self {
Self::Subject { cn: "" } Self::Subject { cn: "" }
} }
@@ -174,17 +174,16 @@ fn gen_certificate(req: GenCertificateReq) -> anyhow::Result<(Option<Vec<u8>>, V
cert_builder.set_not_after(&not_after)?; cert_builder.set_not_after(&not_after)?;
// Specify CRL URL // Specify CRL URL
if let Some(issuer) = req.issuer { if let Some(issuer) = req.issuer
if let Some(crl) = &issuer.crl { && let Some(crl) = &issuer.crl
let crl_url = format!( {
"{}/pki/{}", let crl_url = format!(
AppConfig::get().unsecure_origin(), "{}/pki/{}",
crl.file_name().unwrap().to_string_lossy() AppConfig::get().unsecure_origin(),
); crl.file_name().unwrap().to_string_lossy()
);
cert_builder cert_builder.append_extension(CRLDistributionPointExt { url: crl_url }.as_extension()?)?;
.append_extension(CRLDistributionPointExt { url: crl_url }.as_extension()?)?;
}
} }
// If cert is a CA or not // If cert is a CA or not
@@ -424,12 +423,12 @@ fn refresh_crl(d: &CertData, new_cert: Option<&X509>) -> anyhow::Result<()> {
} }
// Add old entries // Add old entries
if let Some(old_crl) = old_crl { if let Some(old_crl) = old_crl
if let Some(entries) = old_crl.get_revoked() { && let Some(entries) = old_crl.get_revoked()
for entry in entries { {
if X509_CRL_add0_revoked(crl, X509_REVOKED_dup(entry.as_ptr())) == 0 { for entry in entries {
return Err(PKIError::GenCRLError("X509_CRL_add0_revoked").into()); if X509_CRL_add0_revoked(crl, X509_REVOKED_dup(entry.as_ptr())) == 0 {
} return Err(PKIError::GenCRLError("X509_CRL_add0_revoked").into());
} }
} }
} }

View File

@@ -9,9 +9,9 @@ use std::collections::{HashMap, HashSet};
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)] #[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
pub struct DeviceInfo { pub struct DeviceInfo {
/// Device reference /// Device reference
reference: String, pub reference: String,
/// Device firmware / software version /// Device firmware / software version
version: semver::Version, pub version: semver::Version,
/// Maximum number of relay that the device can support /// Maximum number of relay that the device can support
pub max_relays: usize, pub max_relays: usize,
} }
@@ -62,6 +62,9 @@ pub struct Device {
/// ///
/// There cannot be more than [info.max_relays] relays /// There cannot be more than [info.max_relays] relays
pub relays: Vec<DeviceRelay>, pub relays: Vec<DeviceRelay>,
/// Desired version, ie. the version of the software we would to seen run on the device
#[serde(skip_serializing_if = "Option::is_none")]
pub desired_version: Option<semver::Version>,
} }
/// Structure that contains information about the minimal expected execution /// Structure that contains information about the minimal expected execution
@@ -322,9 +325,11 @@ mod tests {
..Default::default() ..Default::default()
}; };
dep_cycle_1.depends_on = vec![dep_cycle_3.id]; dep_cycle_1.depends_on = vec![dep_cycle_3.id];
assert!(dep_cycle_1 assert!(
.error(&[dep_cycle_2.clone(), dep_cycle_3.clone()]) dep_cycle_1
.is_some()); .error(&[dep_cycle_2.clone(), dep_cycle_3.clone()])
.is_some()
);
dep_cycle_1.depends_on = vec![]; dep_cycle_1.depends_on = vec![];
assert!(dep_cycle_1.error(&[dep_cycle_2, dep_cycle_3]).is_none()); assert!(dep_cycle_1.error(&[dep_cycle_2, dep_cycle_3]).is_none());
@@ -348,21 +353,29 @@ mod tests {
..Default::default() ..Default::default()
}; };
assert!(target_relay assert!(
.error(&[other_dep.clone(), second_dep.clone()]) target_relay
.is_some()); .error(&[other_dep.clone(), second_dep.clone()])
assert!(target_relay .is_some()
.error(&[other_dep.clone(), second_dep.clone(), target_relay.clone()]) );
.is_some()); assert!(
target_relay
.error(&[other_dep.clone(), second_dep.clone(), target_relay.clone()])
.is_some()
);
second_dep.conflicts_with = vec![]; second_dep.conflicts_with = vec![];
assert!(target_relay assert!(
.error(&[other_dep.clone(), second_dep.clone()]) target_relay
.is_none()); .error(&[other_dep.clone(), second_dep.clone()])
assert!(target_relay .is_none()
.error(&[other_dep.clone(), second_dep.clone(), target_relay.clone()]) );
.is_none()); assert!(
target_relay
.error(&[other_dep.clone(), second_dep.clone(), target_relay.clone()])
.is_none()
);
// self loop // self loop
let mut self_loop = DeviceRelay { let mut self_loop = DeviceRelay {

View File

@@ -4,7 +4,7 @@ use crate::devices::device::{
Device, DeviceGeneralInfo, DeviceId, DeviceInfo, DeviceRelay, DeviceRelayID, Device, DeviceGeneralInfo, DeviceId, DeviceInfo, DeviceRelay, DeviceRelayID,
}; };
use crate::utils::time_utils::time_secs; use crate::utils::time_utils::time_secs;
use openssl::x509::{X509Req, X509}; use openssl::x509::{X509, X509Req};
use std::collections::HashMap; use std::collections::HashMap;
#[derive(thiserror::Error, Debug)] #[derive(thiserror::Error, Debug)]
@@ -84,6 +84,7 @@ impl DevicesList {
validated: false, validated: false,
enabled: false, enabled: false,
relays: vec![], relays: vec![],
desired_version: None,
}; };
// First, write CSR // First, write CSR
@@ -115,6 +116,11 @@ impl DevicesList {
self.0.clone().into_values().collect() self.0.clone().into_values().collect()
} }
/// Get a reference on the full list of devices
pub fn full_list_ref(&self) -> Vec<&Device> {
self.0.values().collect()
}
/// Get the information about a single device /// Get the information about a single device
pub fn get_single(&self, id: &DeviceId) -> Option<Device> { pub fn get_single(&self, id: &DeviceId) -> Option<Device> {
self.0.get(id).cloned() self.0.get(id).cloned()
@@ -181,6 +187,24 @@ impl DevicesList {
Ok(()) Ok(())
} }
/// Set a device desired version
pub fn set_desired_version(
&mut self,
id: &DeviceId,
version: Option<semver::Version>,
) -> anyhow::Result<()> {
let dev = self
.0
.get_mut(id)
.ok_or(DevicesListError::UpdateDeviceFailedDeviceNotFound)?;
dev.desired_version = version;
self.persist_dev_config(id)?;
Ok(())
}
/// Get single certificate information /// Get single certificate information
fn get_cert(&self, id: &DeviceId) -> anyhow::Result<X509> { fn get_cert(&self, id: &DeviceId) -> anyhow::Result<X509> {
let dev = self let dev = self

View File

@@ -1,5 +1,5 @@
use crate::app_config::{AppConfig, ConsumptionBackend}; use crate::app_config::{AppConfig, ConsumptionBackend};
use rand::{thread_rng, Rng}; use rand::{Rng, rng};
use std::num::ParseIntError; use std::num::ParseIntError;
use std::path::Path; use std::path::Path;
@@ -9,10 +9,36 @@ pub enum ConsumptionError {
NonExistentFile, NonExistentFile,
#[error("The file that should contain the consumption has an invalid content!")] #[error("The file that should contain the consumption has an invalid content!")]
FileInvalidContent(#[source] ParseIntError), FileInvalidContent(#[source] ParseIntError),
#[error("Failed to execute cURL request!")]
CurlReqFailed,
} }
pub type EnergyConsumption = i32; pub type EnergyConsumption = i32;
#[derive(serde::Deserialize)]
struct FroniusResponse {
#[serde(rename = "Body")]
body: FroniusResponseBody,
}
#[derive(serde::Deserialize)]
struct FroniusResponseBody {
#[serde(rename = "Data")]
data: FroniusResponseBodyData,
}
#[derive(serde::Deserialize)]
struct FroniusResponseBodyData {
#[serde(rename = "Site")]
site: FroniusResponseSite,
}
#[derive(serde::Deserialize)]
struct FroniusResponseSite {
#[serde(rename = "P_Grid")]
grid_production: f64,
}
/// Get current electrical energy consumption /// Get current electrical energy consumption
pub async fn get_curr_consumption() -> anyhow::Result<EnergyConsumption> { pub async fn get_curr_consumption() -> anyhow::Result<EnergyConsumption> {
let backend = AppConfig::get() let backend = AppConfig::get()
@@ -23,7 +49,7 @@ pub async fn get_curr_consumption() -> anyhow::Result<EnergyConsumption> {
match backend { match backend {
ConsumptionBackend::Constant { value } => Ok(*value), ConsumptionBackend::Constant { value } => Ok(*value),
ConsumptionBackend::Random { min, max } => Ok(thread_rng().gen_range(*min..*max)), ConsumptionBackend::Random { min, max } => Ok(rng().random_range(*min..*max)),
ConsumptionBackend::File { path } => { ConsumptionBackend::File { path } => {
let path = Path::new(path); let path = Path::new(path);
@@ -38,5 +64,28 @@ pub async fn get_curr_consumption() -> anyhow::Result<EnergyConsumption> {
.parse() .parse()
.map_err(ConsumptionError::FileInvalidContent)?) .map_err(ConsumptionError::FileInvalidContent)?)
} }
ConsumptionBackend::Fronius { fronius_orig, curl } => {
let url = format!("{fronius_orig}/solar_api/v1/GetPowerFlowRealtimeData.fcgi");
let response = match curl {
false => reqwest::get(url).await?.json::<FroniusResponse>().await?,
true => {
let res = std::process::Command::new("curl")
.arg("--connect-timeout")
.arg("1.5")
.arg(url)
.output()?;
if !res.status.success() {
return Err(ConsumptionError::CurlReqFailed.into());
}
serde_json::from_slice::<FroniusResponse>(&res.stdout)?
}
};
Ok(response.body.data.site.grid_production as i32)
}
} }
} }

View File

@@ -1,5 +1,6 @@
use crate::constants; use crate::constants;
use crate::energy::consumption::EnergyConsumption; use crate::energy::consumption::EnergyConsumption;
use crate::utils::math_utils::median;
pub struct ConsumptionCache { pub struct ConsumptionCache {
nb_vals: usize, nb_vals: usize,
@@ -27,13 +28,7 @@ impl ConsumptionCache {
return constants::FALLBACK_PRODUCTION_VALUE; return constants::FALLBACK_PRODUCTION_VALUE;
} }
let mut clone = self.values.clone(); median(&self.values)
clone.sort();
let median = clone[clone.len() / 2];
log::info!("Cached consumption: {:?} / Median: {}", self.values, median);
median
} }
} }

View File

@@ -1,5 +1,6 @@
use crate::app_config::{AppConfig, ConsumptionHistoryType}; use crate::app_config::{AppConfig, ConsumptionHistoryType};
use crate::energy::consumption::EnergyConsumption; use crate::energy::consumption::EnergyConsumption;
use crate::utils::math_utils::median;
use crate::utils::time_utils::day_number; use crate::utils::time_utils::day_number;
const TIME_INTERVAL: usize = 10; const TIME_INTERVAL: usize = 10;
@@ -97,16 +98,48 @@ impl ConsumptionHistoryFile {
)?; )?;
Ok(()) Ok(())
} }
/// Get the total runtime of a relay during a given time window
pub fn get_history(
r#type: ConsumptionHistoryType,
from: u64,
to: u64,
interval: u64,
) -> anyhow::Result<Vec<EnergyConsumption>> {
let mut res = Vec::with_capacity(((to - from) / interval) as usize);
let mut file = Self::open(from, r#type)?;
let mut curr_time = from;
let mut intermediate_values = Vec::new();
while curr_time < to {
if !file.contains_time(curr_time) {
file = Self::open(curr_time, r#type)?;
}
intermediate_values.push(file.get_consumption(curr_time)?);
if curr_time % interval == from % interval {
res.push(median(&intermediate_values));
intermediate_values = Vec::new();
}
curr_time += TIME_INTERVAL as u64;
}
Ok(res)
}
} }
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use crate::app_config::ConsumptionHistoryType;
use crate::energy::consumption::EnergyConsumption; use crate::energy::consumption::EnergyConsumption;
use crate::energy::consumption_history_file::{ConsumptionHistoryFile, TIME_INTERVAL}; use crate::energy::consumption_history_file::{ConsumptionHistoryFile, TIME_INTERVAL};
#[test] #[test]
fn test_consumption_history() { fn test_consumption_history() {
let mut history = ConsumptionHistoryFile::new_memory(0); let mut history =
ConsumptionHistoryFile::new_memory(0, ConsumptionHistoryType::GridConsumption);
for i in 0..50 { for i in 0..50 {
assert_eq!( assert_eq!(

View File

@@ -8,7 +8,7 @@ use crate::energy::consumption;
use crate::energy::consumption::EnergyConsumption; use crate::energy::consumption::EnergyConsumption;
use crate::energy::consumption_cache::ConsumptionCache; use crate::energy::consumption_cache::ConsumptionCache;
use crate::energy::consumption_history_file::ConsumptionHistoryFile; use crate::energy::consumption_history_file::ConsumptionHistoryFile;
use crate::energy::engine::EnergyEngine; use crate::energy::engine::{EnergyEngine, RelayForcedState};
use crate::utils::time_utils::time_secs; use crate::utils::time_utils::time_secs;
use actix::prelude::*; use actix::prelude::*;
use openssl::x509::X509Req; use openssl::x509::X509Req;
@@ -25,7 +25,14 @@ impl EnergyActor {
pub async fn new() -> anyhow::Result<Self> { pub async fn new() -> anyhow::Result<Self> {
let consumption_cache_size = let consumption_cache_size =
AppConfig::get().refresh_interval / AppConfig::get().energy_fetch_interval; AppConfig::get().refresh_interval / AppConfig::get().energy_fetch_interval;
let curr_consumption = consumption::get_curr_consumption().await?; let curr_consumption = match consumption::get_curr_consumption().await {
Ok(v) => v,
Err(e) => {
log::warn!("Failed to fetch consumption, using default value! {e}");
constants::FALLBACK_PRODUCTION_VALUE
}
};
log::info!("Initial consumption value: {curr_consumption}");
let mut consumption_cache = ConsumptionCache::new(consumption_cache_size as usize); let mut consumption_cache = ConsumptionCache::new(consumption_cache_size as usize);
consumption_cache.add_value(curr_consumption); consumption_cache.add_value(curr_consumption);
@@ -53,7 +60,7 @@ impl EnergyActor {
}); });
self.consumption_cache.add_value(latest_consumption); self.consumption_cache.add_value(latest_consumption);
let devices_list = self.devices.full_list(); let devices_list = self.devices.full_list_ref();
let mut history = let mut history =
ConsumptionHistoryFile::open(time_secs(), ConsumptionHistoryType::GridConsumption)?; ConsumptionHistoryFile::open(time_secs(), ConsumptionHistoryType::GridConsumption)?;
@@ -119,7 +126,21 @@ impl Handler<GetCurrConsumption> for EnergyActor {
} }
} }
/// Get current consumption /// Get relays consumption
#[derive(Message)]
#[rtype(result = "usize")]
pub struct RelaysConsumption;
impl Handler<RelaysConsumption> for EnergyActor {
type Result = usize;
fn handle(&mut self, _msg: RelaysConsumption, _ctx: &mut Context<Self>) -> Self::Result {
self.engine
.sum_relays_consumption(&self.devices.full_list_ref())
}
}
/// Check if device exists
#[derive(Message)] #[derive(Message)]
#[rtype(result = "bool")] #[rtype(result = "bool")]
pub struct CheckDeviceExists(pub DeviceId); pub struct CheckDeviceExists(pub DeviceId);
@@ -181,6 +202,27 @@ impl Handler<UpdateDeviceGeneralInfo> for EnergyActor {
} }
} }
/// Set device desired version
#[derive(Message)]
#[rtype(result = "anyhow::Result<()>")]
pub struct SetDesiredVersion(pub DeviceId, pub Option<semver::Version>);
impl Handler<SetDesiredVersion> for EnergyActor {
type Result = anyhow::Result<()>;
fn handle(&mut self, msg: SetDesiredVersion, _ctx: &mut Context<Self>) -> Self::Result {
log::info!(
"Requested to update device desired version {:?} => {:#?}",
&msg.0,
&msg.1
);
self.devices.set_desired_version(&msg.0, msg.1)?;
Ok(())
}
}
/// Delete a device /// Delete a device
#[derive(Message)] #[derive(Message)]
#[rtype(result = "anyhow::Result<()>")] #[rtype(result = "anyhow::Result<()>")]
@@ -286,6 +328,19 @@ impl Handler<UpdateDeviceRelay> for EnergyActor {
} }
} }
#[derive(Message)]
#[rtype(result = "anyhow::Result<()>")]
pub struct SetRelayForcedState(pub DeviceRelayID, pub RelayForcedState);
impl Handler<SetRelayForcedState> for EnergyActor {
type Result = anyhow::Result<()>;
fn handle(&mut self, msg: SetRelayForcedState, _ctx: &mut Context<Self>) -> Self::Result {
self.engine.relay_state(msg.0).set_forced(msg.1);
Ok(())
}
}
/// Delete a device relay /// Delete a device relay
#[derive(Message)] #[derive(Message)]
#[rtype(result = "anyhow::Result<()>")] #[rtype(result = "anyhow::Result<()>")]
@@ -360,3 +415,36 @@ impl Handler<GetDevicesState> for EnergyActor {
.collect() .collect()
} }
} }
#[derive(serde::Serialize)]
pub struct ResRelayState {
pub id: DeviceRelayID,
pub on: bool,
pub r#for: usize,
pub forced_state: RelayForcedState,
}
/// Get the state of all relays
#[derive(Message)]
#[rtype(result = "Vec<ResRelayState>")]
pub struct GetAllRelaysState;
impl Handler<GetAllRelaysState> for EnergyActor {
type Result = Vec<ResRelayState>;
fn handle(&mut self, _msg: GetAllRelaysState, _ctx: &mut Context<Self>) -> Self::Result {
let mut list = vec![];
for d in &self.devices.relays_list() {
let state = self.engine.relay_state(d.id);
list.push(ResRelayState {
id: d.id,
on: state.is_on(),
r#for: state.state_for(),
forced_state: state.actual_forced_state(),
})
}
list
}
}

View File

@@ -1,14 +1,14 @@
use std::collections::HashMap; use std::collections::HashMap;
use crate::app_config::AppConfig; use crate::app_config::AppConfig;
use prettytable::{row, Table}; use prettytable::{Table, row};
use crate::constants; use crate::constants;
use crate::devices::device::{Device, DeviceId, DeviceRelay, DeviceRelayID}; use crate::devices::device::{Device, DeviceId, DeviceRelay, DeviceRelayID};
use crate::energy::consumption::EnergyConsumption; use crate::energy::consumption::EnergyConsumption;
use crate::energy::relay_state_history; use crate::energy::relay_state_history;
use crate::energy::relay_state_history::RelayStateHistory; use crate::energy::relay_state_history::RelayStateHistory;
use crate::utils::time_utils::{curr_hour, time_secs, time_start_of_day}; use crate::utils::time_utils::{curr_hour, time_secs};
#[derive(Default)] #[derive(Default)]
pub struct DeviceState { pub struct DeviceState {
@@ -25,19 +25,87 @@ impl DeviceState {
} }
} }
#[derive(Default, Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
#[serde(tag = "type")]
pub enum SetRelayForcedStateReq {
#[default]
None,
Off {
for_secs: u64,
},
On {
for_secs: u64,
},
}
impl SetRelayForcedStateReq {
pub fn to_forced_state(&self) -> RelayForcedState {
match &self {
SetRelayForcedStateReq::None => RelayForcedState::None,
SetRelayForcedStateReq::Off { for_secs } => RelayForcedState::Off {
until: time_secs() + for_secs,
},
SetRelayForcedStateReq::On { for_secs } => RelayForcedState::On {
until: time_secs() + for_secs,
},
}
}
}
#[derive(Default, Debug, Clone, Eq, PartialEq, serde::Serialize, serde::Deserialize)]
#[serde(tag = "type")]
pub enum RelayForcedState {
#[default]
None,
Off {
until: u64,
},
On {
until: u64,
},
}
#[derive(Default, Clone)] #[derive(Default, Clone)]
pub struct RelayState { pub struct RelayState {
on: bool, on: bool,
since: usize, since: usize,
forced_state: RelayForcedState,
} }
impl RelayState { impl RelayState {
/// Get actual forced state (returns None if state is expired)
pub fn actual_forced_state(&self) -> RelayForcedState {
match self.forced_state {
RelayForcedState::Off { until } if until > time_secs() => {
RelayForcedState::Off { until }
}
RelayForcedState::On { until } if until > time_secs() => RelayForcedState::On { until },
_ => RelayForcedState::None,
}
}
pub fn is_on(&self) -> bool { pub fn is_on(&self) -> bool {
self.on let forced_state = self.actual_forced_state();
(self.on || matches!(forced_state, RelayForcedState::On { .. }))
&& !matches!(forced_state, RelayForcedState::Off { .. })
} }
fn is_off(&self) -> bool { fn is_off(&self) -> bool {
!self.on !self.is_on()
}
/// Check if relay state is enforced
pub fn is_forced(&self) -> bool {
self.actual_forced_state() != RelayForcedState::None
}
pub fn set_forced(&mut self, s: RelayForcedState) {
self.since = time_secs() as usize;
self.forced_state = s;
}
pub fn state_for(&self) -> usize {
(time_secs() - self.since as u64) as usize
} }
} }
@@ -51,7 +119,7 @@ pub struct EnergyEngine {
impl DeviceRelay { impl DeviceRelay {
// Note : this function is not recursive // Note : this function is not recursive
fn has_running_dependencies(&self, s: &RelaysState, devices: &[Device]) -> bool { fn has_running_dependencies(&self, s: &RelaysState, devices: &[&Device]) -> bool {
for d in devices { for d in devices {
for r in &d.relays { for r in &d.relays {
if r.depends_on.contains(&self.id) && s.get(&r.id).unwrap().is_on() { if r.depends_on.contains(&self.id) && s.get(&r.id).unwrap().is_on() {
@@ -68,7 +136,7 @@ impl DeviceRelay {
self.depends_on.iter().any(|id| s.get(id).unwrap().is_off()) self.depends_on.iter().any(|id| s.get(id).unwrap().is_off())
} }
fn is_having_conflict(&self, s: &RelaysState, devices: &[Device]) -> bool { fn is_having_conflict(&self, s: &RelaysState, devices: &[&Device]) -> bool {
if self if self
.conflicts_with .conflicts_with
.iter() .iter()
@@ -90,7 +158,7 @@ impl DeviceRelay {
} }
} }
fn sum_relays_consumption(state: &RelaysState, devices: &[Device]) -> usize { fn sum_relays_consumption(state: &RelaysState, devices: &[&Device]) -> usize {
let mut consumption = 0; let mut consumption = 0;
for d in devices { for d in devices {
@@ -115,11 +183,11 @@ impl EnergyEngine {
self.relays_state.get_mut(&relay_id).unwrap() self.relays_state.get_mut(&relay_id).unwrap()
} }
pub fn sum_relays_consumption(&self, devices: &[Device]) -> usize { pub fn sum_relays_consumption(&self, devices: &[&Device]) -> usize {
sum_relays_consumption(&self.relays_state, devices) sum_relays_consumption(&self.relays_state, devices)
} }
fn print_summary(&mut self, curr_consumption: EnergyConsumption, devices: &[Device]) { fn print_summary(&mut self, curr_consumption: EnergyConsumption, devices: &[&Device]) {
log::info!("Current consumption: {curr_consumption}"); log::info!("Current consumption: {curr_consumption}");
let mut table = Table::new(); let mut table = Table::new();
@@ -142,7 +210,11 @@ impl EnergyEngine {
r.name, r.name,
r.consumption, r.consumption,
format!("{} / {}", r.minimal_downtime, r.minimal_uptime), format!("{} / {}", r.minimal_downtime, r.minimal_uptime),
status.is_on().to_string(), status.is_on().to_string()
+ match status.is_forced() {
true => " (Forced)",
false => "",
},
status.since, status.since,
match dev_online { match dev_online {
true => "Online", true => "Online",
@@ -168,13 +240,13 @@ impl EnergyEngine {
pub fn estimated_consumption_without_relays( pub fn estimated_consumption_without_relays(
&self, &self,
curr_consumption: EnergyConsumption, curr_consumption: EnergyConsumption,
devices: &[Device], devices: &[&Device],
) -> EnergyConsumption { ) -> EnergyConsumption {
curr_consumption - self.sum_relays_consumption(devices) as i32 curr_consumption - self.sum_relays_consumption(devices) as i32
} }
/// Refresh energy engine; this method shall never fail ! /// Refresh energy engine; this method shall never fail !
pub fn refresh(&mut self, curr_consumption: EnergyConsumption, devices: &[Device]) { pub fn refresh(&mut self, curr_consumption: EnergyConsumption, devices: &[&Device]) {
let base_production = self.estimated_consumption_without_relays(curr_consumption, devices); let base_production = self.estimated_consumption_without_relays(curr_consumption, devices);
log::info!("Estimated base production: {base_production}"); log::info!("Estimated base production: {base_production}");
@@ -188,19 +260,28 @@ impl EnergyEngine {
let mut new_relays_state = self.relays_state.clone(); let mut new_relays_state = self.relays_state.clone();
// Forcefully turn off relays that belongs to offline devices // Forcefully turn off disabled relays
for d in devices { for d in devices {
if !self.device_state(&d.id).is_online() { for r in &d.relays {
for r in &d.relays { if !r.enabled || !d.enabled {
new_relays_state.get_mut(&r.id).unwrap().on = false; new_relays_state.get_mut(&r.id).unwrap().on = false;
} }
} }
} }
// Forcefully turn off disabled relays // Apply forced relays state
for d in devices { for d in devices {
for r in &d.relays { for r in &d.relays {
if !r.enabled || !d.enabled { if self.relay_state(r.id).is_forced() {
new_relays_state.get_mut(&r.id).unwrap().on = self.relay_state(r.id).is_on();
}
}
}
// Forcefully turn off relays that belongs to offline devices
for d in devices {
if !self.device_state(&d.id).is_online() {
for r in &d.relays {
new_relays_state.get_mut(&r.id).unwrap().on = false; new_relays_state.get_mut(&r.id).unwrap().on = false;
} }
} }
@@ -212,7 +293,9 @@ impl EnergyEngine {
for d in devices { for d in devices {
for r in &d.relays { for r in &d.relays {
if new_relays_state.get(&r.id).unwrap().is_off() { if new_relays_state.get(&r.id).unwrap().is_off()
|| new_relays_state.get(&r.id).unwrap().is_forced()
{
continue; continue;
} }
@@ -236,7 +319,7 @@ impl EnergyEngine {
for d in devices { for d in devices {
for r in &d.relays { for r in &d.relays {
let state = new_relays_state.get(&r.id).unwrap(); let state = new_relays_state.get(&r.id).unwrap();
if state.is_off() { if state.is_off() || state.is_forced() {
continue; continue;
} }
@@ -267,7 +350,9 @@ impl EnergyEngine {
continue; continue;
} }
if new_relays_state.get(&r.id).unwrap().is_on() { if new_relays_state.get(&r.id).unwrap().is_on()
|| new_relays_state.get(&r.id).unwrap().is_forced()
{
continue; continue;
} }
@@ -279,23 +364,22 @@ impl EnergyEngine {
continue; continue;
} }
let time_start_day = time_start_of_day().unwrap_or(1726696800); let total_runtime = relay_state_history::relay_total_runtime_adjusted(r);
let start_time = time_start_day + constraints.reset_time as u64;
let end_time = time_start_day + 3600 * 24 + constraints.reset_time as u64;
let total_runtime =
relay_state_history::relay_total_runtime(r.id, start_time, end_time)
.unwrap_or(3600 * 24);
if total_runtime > constraints.min_runtime { if total_runtime > constraints.min_runtime {
continue; continue;
} }
log::info!("Forcefully turn on relay {} to catch up running constraints (only {}s this day)", r.name, total_runtime); log::info!(
"Forcefully turn on relay {} to catch up running constraints (only {}s this day)",
r.name,
total_runtime
);
new_relays_state.get_mut(&r.id).unwrap().on = true; new_relays_state.get_mut(&r.id).unwrap().on = true;
} }
} }
// Order relays // Order relays to select the ones with the most elevated priorities
let mut ordered_relays = devices let mut ordered_relays = devices
.iter() .iter()
.filter(|d| self.device_state(&d.id).is_online() && d.enabled) .filter(|d| self.device_state(&d.id).is_online() && d.enabled)
@@ -305,10 +389,13 @@ impl EnergyEngine {
ordered_relays.sort_by_key(|r| r.priority); ordered_relays.sort_by_key(|r| r.priority);
ordered_relays.reverse(); ordered_relays.reverse();
// Select relays to start, starting with those with highest priorities
loop { loop {
let mut changed = false; let mut changed = false;
for relay in &ordered_relays { for relay in &ordered_relays {
if new_relays_state.get(&relay.id).unwrap().is_on() { if new_relays_state.get(&relay.id).unwrap().is_on()
|| new_relays_state.get(&relay.id).unwrap().is_forced()
{
continue; continue;
} }
@@ -362,7 +449,7 @@ impl EnergyEngine {
} }
/// Save relays state to disk /// Save relays state to disk
pub fn persist_relays_state(&mut self, devices: &[Device]) -> anyhow::Result<()> { pub fn persist_relays_state(&mut self, devices: &[&Device]) -> anyhow::Result<()> {
// Save all relays state // Save all relays state
for d in devices { for d in devices {
for r in &d.relays { for r in &d.relays {
@@ -380,7 +467,7 @@ impl EnergyEngine {
mod test { mod test {
use crate::devices::device::{Device, DeviceId, DeviceRelayID}; use crate::devices::device::{Device, DeviceId, DeviceRelayID};
use crate::energy::consumption::EnergyConsumption; use crate::energy::consumption::EnergyConsumption;
use crate::energy::engine::EnergyEngine; use crate::energy::engine::{EnergyEngine, SetRelayForcedStateReq};
use crate::utils::time_utils::time_secs; use crate::utils::time_utils::time_secs;
use rust_embed::Embed; use rust_embed::Embed;
@@ -389,6 +476,8 @@ mod test {
id: DeviceRelayID, id: DeviceRelayID,
on: bool, on: bool,
r#for: usize, r#for: usize,
#[serde(default)]
forced_state: SetRelayForcedStateReq,
should_be_on: bool, should_be_on: bool,
} }
@@ -436,6 +525,7 @@ mod test {
let s = engine.relay_state(r.id); let s = engine.relay_state(r.id);
s.on = r.on; s.on = r.on;
s.since = time_secs() as usize - r.r#for; s.since = time_secs() as usize - r.r#for;
s.forced_state = r.forced_state.to_forced_state()
} }
} }
@@ -450,7 +540,7 @@ mod test {
fn run_test(name: &str, conf: &str) { fn run_test(name: &str, conf: &str) {
let (devices, mut energy_engine, consumption, states) = parse_test_config(conf); let (devices, mut energy_engine, consumption, states) = parse_test_config(conf);
energy_engine.refresh(consumption, &devices); energy_engine.refresh(consumption, &devices.iter().collect::<Vec<_>>());
for (device_s, device) in states.iter().zip(&devices) { for (device_s, device) in states.iter().zip(&devices) {
for (relay_s, relay) in device_s.relays.iter().zip(&device.relays) { for (relay_s, relay) in device_s.relays.iter().zip(&device.relays) {

View File

@@ -1,7 +1,7 @@
use crate::app_config::AppConfig; use crate::app_config::AppConfig;
use crate::devices::device::DeviceRelayID; use crate::devices::device::{DeviceRelay, DeviceRelayID};
use crate::utils::files_utils; use crate::utils::files_utils;
use crate::utils::time_utils::day_number; use crate::utils::time_utils::{day_number, time_secs, time_start_of_day};
const TIME_INTERVAL: usize = 30; const TIME_INTERVAL: usize = 30;
@@ -119,10 +119,35 @@ pub fn relay_total_runtime(device_id: DeviceRelayID, from: u64, to: u64) -> anyh
Ok(total) Ok(total)
} }
/// Get the total runtime of a relay taking account of daily reset time
pub fn relay_total_runtime_adjusted(relay: &DeviceRelay) -> usize {
let reset_time = relay
.daily_runtime
.as_ref()
.map(|r| r.reset_time)
.unwrap_or(0);
let time_start_day = time_start_of_day().unwrap_or(1726696800);
// Check if we have reached reset_time today yet or not
if time_start_day + reset_time as u64 <= time_secs() {
let start_time = time_start_day + reset_time as u64;
let end_time = time_start_day + 3600 * 24 + reset_time as u64;
relay_total_runtime(relay.id, start_time, end_time).unwrap_or(3600 * 24)
}
// If we have not reached reset time yet, we need to focus on previous day
else {
let time_start_yesterday = time_start_day - 3600 * 24;
let start_time = time_start_yesterday + reset_time as u64;
let end_time = time_start_day + reset_time as u64;
relay_total_runtime(relay.id, start_time, end_time).unwrap_or(3600 * 24)
}
}
#[cfg(test)] #[cfg(test)]
mod tests { mod tests {
use crate::devices::device::DeviceRelayID; use crate::devices::device::DeviceRelayID;
use crate::energy::relay_state_history::{relay_total_runtime, RelayStateHistory}; use crate::energy::relay_state_history::{RelayStateHistory, relay_total_runtime};
#[test] #[test]
fn test_relay_state_history() { fn test_relay_state_history() {

View File

@@ -3,5 +3,7 @@ pub mod constants;
pub mod crypto; pub mod crypto;
pub mod devices; pub mod devices;
pub mod energy; pub mod energy;
pub mod logs;
pub mod ota;
pub mod server; pub mod server;
pub mod utils; pub mod utils;

View File

@@ -0,0 +1,17 @@
use crate::devices::device::DeviceId;
use crate::logs::severity::LogSeverity;
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone)]
pub struct LogEntry {
/// If no device is specified then the message comes from the backend
pub device_id: Option<DeviceId>,
pub time: u64,
pub severity: LogSeverity,
pub message: String,
}
impl LogEntry {
pub fn serialize(&self) -> anyhow::Result<String> {
Ok(serde_json::to_string(self)?)
}
}

View File

@@ -0,0 +1,58 @@
use crate::app_config::AppConfig;
use crate::devices::device::DeviceId;
use crate::logs::log_entry::LogEntry;
use crate::logs::severity::LogSeverity;
use crate::utils::time_utils::{curr_day_number, time_secs};
use fs4::fs_std::FileExt;
use std::fs::OpenOptions;
use std::io::{Seek, SeekFrom, Write};
pub fn save_log(
device: Option<&DeviceId>,
severity: LogSeverity,
message: String,
) -> anyhow::Result<()> {
let log_path = AppConfig::get().log_of_day(curr_day_number());
let mut file = OpenOptions::new()
.append(true)
.create(true)
.open(&log_path)?;
file.lock_exclusive()?;
file.seek(SeekFrom::End(0))?;
file.write_all(
format!(
"{}\n",
(LogEntry {
device_id: device.cloned(),
time: time_secs(),
severity,
message,
})
.serialize()?
)
.as_bytes(),
)?;
file.flush()?;
fs4::fs_std::FileExt::unlock(&file)?;
Ok(())
}
/// Make a logs extraction
pub fn get_logs(day: u64) -> anyhow::Result<Vec<LogEntry>> {
let file = AppConfig::get().log_of_day(day);
if !file.exists() {
return Ok(Vec::new());
}
let content = std::fs::read_to_string(file)?
.split('\n')
.filter(|l| !l.is_empty())
.map(serde_json::from_str)
.collect::<Result<Vec<_>, _>>()?;
Ok(content)
}

View File

@@ -0,0 +1,3 @@
pub mod log_entry;
pub mod logs_manager;
pub mod severity;

View File

@@ -0,0 +1,7 @@
#[derive(serde::Serialize, serde::Deserialize, Copy, Clone, Debug, PartialOrd, Eq, PartialEq)]
pub enum LogSeverity {
Debug = 0,
Info,
Warn,
Error,
}

View File

@@ -5,10 +5,13 @@ use central_backend::energy::energy_actor::EnergyActor;
use central_backend::server::servers; use central_backend::server::servers;
use central_backend::utils::files_utils::create_directory_if_missing; use central_backend::utils::files_utils::create_directory_if_missing;
use futures::future; use futures::future;
use tokio_schedule::{every, Job}; use tokio_schedule::{Job, every};
#[actix_web::main] #[actix_web::main]
async fn main() -> std::io::Result<()> { async fn main() -> std::io::Result<()> {
// Load additional config from file, if requested
AppConfig::parse_env_file().expect("Failed to parse environment file!");
// Initialize OpenSSL // Initialize OpenSSL
openssl_sys::init(); openssl_sys::init();
@@ -19,6 +22,8 @@ async fn main() -> std::io::Result<()> {
create_directory_if_missing(AppConfig::get().devices_config_path()).unwrap(); create_directory_if_missing(AppConfig::get().devices_config_path()).unwrap();
create_directory_if_missing(AppConfig::get().relays_runtime_stats_storage_path()).unwrap(); create_directory_if_missing(AppConfig::get().relays_runtime_stats_storage_path()).unwrap();
create_directory_if_missing(AppConfig::get().energy_consumption_history()).unwrap(); create_directory_if_missing(AppConfig::get().energy_consumption_history()).unwrap();
create_directory_if_missing(AppConfig::get().logs_dir()).unwrap();
create_directory_if_missing(AppConfig::get().ota_dir()).unwrap();
// Initialize PKI // Initialize PKI
pki::initialize_root_ca().expect("Failed to initialize Root CA!"); pki::initialize_root_ca().expect("Failed to initialize Root CA!");
@@ -42,8 +47,8 @@ async fn main() -> std::io::Result<()> {
.expect("Failed to initialize energy actor!") .expect("Failed to initialize energy actor!")
.start(); .start();
let s1 = servers::secure_server(actor); let s1 = servers::secure_server(actor.clone());
let s2 = servers::unsecure_server(); let s2 = servers::unsecure_server(actor);
future::try_join(s1, s2) future::try_join(s1, s2)
.await .await
.expect("Failed to start servers!"); .expect("Failed to start servers!");

View File

@@ -0,0 +1,2 @@
pub mod ota_manager;
pub mod ota_update;

View File

@@ -0,0 +1,74 @@
use crate::app_config::AppConfig;
use crate::ota::ota_update::{OTAPlatform, OTAUpdate};
use crate::utils::files_utils;
use std::os::unix::fs::MetadataExt;
use std::str::FromStr;
/// Check out whether a given update exists or not
pub fn update_exists(platform: OTAPlatform, version: &semver::Version) -> anyhow::Result<bool> {
Ok(AppConfig::get()
.path_ota_update(platform, version)
.is_file())
}
/// Save a new firmware update
pub fn save_update(
platform: OTAPlatform,
version: &semver::Version,
update: &[u8],
) -> anyhow::Result<()> {
let path = AppConfig::get().path_ota_update(platform, version);
files_utils::create_directory_if_missing(path.parent().unwrap())?;
std::fs::write(path, update)?;
Ok(())
}
/// Get the content of an OTA update
pub fn get_ota_update(platform: OTAPlatform, version: &semver::Version) -> anyhow::Result<Vec<u8>> {
let path = AppConfig::get().path_ota_update(platform, version);
Ok(std::fs::read(path)?)
}
/// Delete an OTA update
pub fn delete_update(platform: OTAPlatform, version: &semver::Version) -> anyhow::Result<()> {
let path = AppConfig::get().path_ota_update(platform, version);
std::fs::remove_file(path)?;
Ok(())
}
/// Get the list of OTA software updates for a platform
pub fn get_ota_updates_for_platform(platform: OTAPlatform) -> anyhow::Result<Vec<OTAUpdate>> {
let ota_path = AppConfig::get().ota_platform_dir(platform);
// Check if the directory dedicated to the updates of the platform exists
if !ota_path.is_dir() {
return Ok(Vec::new());
}
let mut out = Vec::new();
for e in std::fs::read_dir(ota_path)? {
let e = e?;
out.push(OTAUpdate {
platform,
version: semver::Version::from_str(e.file_name().to_str().unwrap_or("bad"))?,
file_size: e.metadata()?.size(),
});
}
Ok(out)
}
/// Get all the available OTA updates
pub fn get_all_ota_updates() -> anyhow::Result<Vec<OTAUpdate>> {
let mut out = vec![];
for p in OTAPlatform::supported_platforms() {
out.append(&mut get_ota_updates_for_platform(*p)?)
}
Ok(out)
}

View File

@@ -0,0 +1,38 @@
use std::fmt::{Display, Formatter};
use std::str::FromStr;
#[derive(serde::Serialize, serde::Deserialize, Debug, Copy, Clone, Eq, PartialEq)]
pub enum OTAPlatform {
#[serde(rename = "Wt32-Eth01")]
Wt32Eth01,
}
impl OTAPlatform {
/// Get the list of supported platforms
pub fn supported_platforms() -> &'static [Self] {
&[OTAPlatform::Wt32Eth01]
}
}
impl Display for OTAPlatform {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
let s = serde_json::to_string(&self).unwrap().replace('"', "");
write!(f, "{s}")
}
}
impl FromStr for OTAPlatform {
type Err = anyhow::Error;
fn from_str(s: &str) -> Result<Self, Self::Err> {
Ok(serde_json::from_str::<Self>(&format!("\"{s}\""))?)
}
}
/// Single OTA update information
#[derive(serde::Serialize, serde::Deserialize, Debug, Clone, Eq, PartialEq)]
pub struct OTAUpdate {
pub platform: OTAPlatform,
pub version: semver::Version,
pub file_size: u64,
}

View File

@@ -1,5 +1,5 @@
use actix_identity::Identity; use actix_identity::Identity;
use std::future::{ready, Ready}; use std::future::{Ready, ready};
use std::rc::Rc; use std::rc::Rc;
use crate::app_config::AppConfig; use crate::app_config::AppConfig;
@@ -7,8 +7,8 @@ use crate::constants;
use actix_web::body::EitherBody; use actix_web::body::EitherBody;
use actix_web::dev::Payload; use actix_web::dev::Payload;
use actix_web::{ use actix_web::{
dev::{forward_ready, Service, ServiceRequest, ServiceResponse, Transform},
Error, FromRequest, HttpResponse, Error, FromRequest, HttpResponse,
dev::{Service, ServiceRequest, ServiceResponse, Transform, forward_ready},
}; };
use futures_util::future::LocalBoxFuture; use futures_util::future::LocalBoxFuture;

View File

@@ -1,9 +1,9 @@
use actix_web::HttpResponse;
use actix_web::body::BoxBody; use actix_web::body::BoxBody;
use actix_web::http::StatusCode; use actix_web::http::StatusCode;
use actix_web::HttpResponse;
use std::error::Error; use std::error::Error;
use std::fmt::{Display, Formatter}; use std::fmt::{Display, Formatter};
use std::io::ErrorKind; use zip::result::ZipError;
/// Custom error to ease controller writing /// Custom error to ease controller writing
#[derive(Debug)] #[derive(Debug)]
@@ -31,7 +31,7 @@ impl actix_web::error::ResponseError for HttpErr {
} }
} }
fn error_response(&self) -> HttpResponse<BoxBody> { fn error_response(&self) -> HttpResponse<BoxBody> {
log::error!("Error while processing request! {}", self); log::error!("Error while processing request! {self}");
HttpResponse::InternalServerError().body("Failed to execute request!") HttpResponse::InternalServerError().body("Failed to execute request!")
} }
@@ -51,7 +51,7 @@ impl From<serde_json::Error> for HttpErr {
impl From<Box<dyn Error>> for HttpErr { impl From<Box<dyn Error>> for HttpErr {
fn from(value: Box<dyn Error>) -> Self { fn from(value: Box<dyn Error>) -> Self {
HttpErr::Err(std::io::Error::new(ErrorKind::Other, value.to_string()).into()) HttpErr::Err(std::io::Error::other(value.to_string()).into())
} }
} }
@@ -81,31 +81,43 @@ impl From<reqwest::header::ToStrError> for HttpErr {
impl From<actix_web::Error> for HttpErr { impl From<actix_web::Error> for HttpErr {
fn from(value: actix_web::Error) -> Self { fn from(value: actix_web::Error) -> Self {
HttpErr::Err(std::io::Error::new(ErrorKind::Other, value.to_string()).into()) HttpErr::Err(std::io::Error::other(value.to_string()).into())
} }
} }
impl From<actix::MailboxError> for HttpErr { impl From<actix::MailboxError> for HttpErr {
fn from(value: actix::MailboxError) -> Self { fn from(value: actix::MailboxError) -> Self {
HttpErr::Err(std::io::Error::new(ErrorKind::Other, value.to_string()).into()) HttpErr::Err(std::io::Error::other(value.to_string()).into())
} }
} }
impl From<actix_identity::error::GetIdentityError> for HttpErr { impl From<actix_identity::error::GetIdentityError> for HttpErr {
fn from(value: actix_identity::error::GetIdentityError) -> Self { fn from(value: actix_identity::error::GetIdentityError) -> Self {
HttpErr::Err(std::io::Error::new(ErrorKind::Other, value.to_string()).into()) HttpErr::Err(std::io::Error::other(value.to_string()).into())
} }
} }
impl From<actix_identity::error::LoginError> for HttpErr { impl From<actix_identity::error::LoginError> for HttpErr {
fn from(value: actix_identity::error::LoginError) -> Self { fn from(value: actix_identity::error::LoginError) -> Self {
HttpErr::Err(std::io::Error::new(ErrorKind::Other, value.to_string()).into()) HttpErr::Err(std::io::Error::other(value.to_string()).into())
} }
} }
impl From<openssl::error::ErrorStack> for HttpErr { impl From<openssl::error::ErrorStack> for HttpErr {
fn from(value: openssl::error::ErrorStack) -> Self { fn from(value: openssl::error::ErrorStack) -> Self {
HttpErr::Err(std::io::Error::new(ErrorKind::Other, value.to_string()).into()) HttpErr::Err(std::io::Error::other(value.to_string()).into())
}
}
impl From<ZipError> for HttpErr {
fn from(value: ZipError) -> Self {
HttpErr::Err(std::io::Error::other(value.to_string()).into())
}
}
impl From<walkdir::Error> for HttpErr {
fn from(value: walkdir::Error) -> Self {
HttpErr::Err(std::io::Error::other(value.to_string()).into())
} }
} }

View File

@@ -0,0 +1,22 @@
use crate::logs::logs_manager;
use crate::logs::severity::LogSeverity;
use crate::server::WebEnergyActor;
use crate::server::custom_error::HttpResult;
use crate::server::devices_api::jwt_parser::JWTRequest;
use actix_web::{HttpResponse, web};
#[derive(Debug, serde::Deserialize, Clone)]
pub struct LogRequest {
severity: LogSeverity,
message: String,
}
/// Report log message from device
pub async fn report_log(body: web::Json<JWTRequest>, actor: WebEnergyActor) -> HttpResult {
let (device, request) = body.parse_jwt::<LogRequest>(actor).await?;
log::info!("Save log message from device: {request:#?}");
logs_manager::save_log(Some(&device.id), request.severity, request.message)?;
Ok(HttpResponse::Accepted().finish())
}

View File

@@ -0,0 +1,21 @@
use crate::ota::ota_manager;
use crate::ota::ota_update::OTAPlatform;
use crate::server::custom_error::HttpResult;
use actix_web::{HttpResponse, web};
#[derive(serde::Deserialize)]
pub struct FirmwarePath {
platform: OTAPlatform,
version: semver::Version,
}
/// Download firmware update
pub async fn retrieve_firmware(path: web::Path<FirmwarePath>) -> HttpResult {
if !ota_manager::update_exists(path.platform, &path.version)? {
return Ok(HttpResponse::NotFound().json("The requested firmware was not found!"));
}
let firmware = ota_manager::get_ota_update(path.platform, &path.version)?;
Ok(HttpResponse::Ok().body(firmware))
}

View File

@@ -0,0 +1,96 @@
use crate::app_config::AppConfig;
use crate::crypto::pki;
use crate::devices::device::{Device, DeviceId};
use crate::energy::energy_actor;
use crate::server::WebEnergyActor;
use jsonwebtoken::{Algorithm, DecodingKey, Validation};
use openssl::x509::X509;
use serde::de::DeserializeOwned;
use std::collections::HashSet;
#[derive(thiserror::Error, Debug)]
pub enum JWTError {
#[error("Failed to decode JWT header")]
FailedDecodeJWT,
#[error("Missing KID in JWT!")]
MissingKidInJWT,
#[error("Sent a JWT for a device which does not exists!")]
DeviceDoesNotExists,
#[error("Sent a JWT for a device which is not validated!")]
DeviceNotValidated,
#[error("Sent a JWT using a revoked certificate!")]
RevokedCertificate,
#[error("Failed to validate JWT!")]
FailedValidateJWT,
}
#[derive(serde::Deserialize)]
pub struct JWTRequest {
pub payload: String,
}
impl JWTRequest {
pub async fn parse_jwt<E: DeserializeOwned + std::clone::Clone>(
&self,
actor: WebEnergyActor,
) -> anyhow::Result<(Device, E)> {
// First, we need to extract device kid from query
let Ok(jwt_header) = jsonwebtoken::decode_header(&self.payload) else {
log::error!("Failed to decode JWT header!");
return Err(JWTError::FailedDecodeJWT.into());
};
let Some(kid) = jwt_header.kid else {
log::error!("Missing KID in JWT!");
return Err(JWTError::MissingKidInJWT.into());
};
// Fetch device information
let Some(device) = actor
.send(energy_actor::GetSingleDevice(DeviceId(kid)))
.await?
else {
log::error!("Sent a JWT for a device which does not exists!");
return Err(JWTError::DeviceDoesNotExists.into());
};
if !device.validated {
log::error!("Sent a JWT for a device which is not validated!");
return Err(JWTError::DeviceNotValidated.into());
}
// Check certificate revocation status
let cert_bytes = std::fs::read(AppConfig::get().device_cert_path(&device.id))?;
let certificate = X509::from_pem(&cert_bytes)?;
if pki::CertData::load_devices_ca()?.is_revoked(&certificate)? {
log::error!("Sent a JWT using a revoked certificate!");
return Err(JWTError::RevokedCertificate.into());
}
let (key, alg) = match DecodingKey::from_ec_pem(&cert_bytes) {
Ok(key) => (key, Algorithm::ES256),
Err(e) => {
log::warn!("Failed to decode certificate as EC certificate {e}, trying RSA...");
(
DecodingKey::from_rsa_pem(&cert_bytes)
.expect("Failed to decode RSA certificate"),
Algorithm::RS256,
)
}
};
let mut validation = Validation::new(alg);
validation.validate_exp = false;
validation.required_spec_claims = HashSet::default();
let c = match jsonwebtoken::decode::<E>(&self.payload, &key, &validation) {
Ok(c) => c,
Err(e) => {
log::error!("Failed to validate JWT! {e}");
return Err(JWTError::FailedValidateJWT.into());
}
};
Ok((device, c.claims))
}
}

View File

@@ -1,14 +1,16 @@
use crate::app_config::AppConfig; use crate::app_config::AppConfig;
use crate::crypto::pki;
use crate::devices::device::{DeviceId, DeviceInfo}; use crate::devices::device::{DeviceId, DeviceInfo};
use crate::energy::energy_actor; use crate::energy::energy_actor;
use crate::server::custom_error::HttpResult; use crate::energy::energy_actor::RelaySyncStatus;
use crate::ota::ota_manager;
use crate::ota::ota_update::OTAPlatform;
use crate::server::WebEnergyActor; use crate::server::WebEnergyActor;
use actix_web::{web, HttpResponse}; use crate::server::custom_error::HttpResult;
use jsonwebtoken::{Algorithm, DecodingKey, Validation}; use crate::server::devices_api::jwt_parser::JWTRequest;
use actix_web::{HttpResponse, web};
use openssl::nid::Nid; use openssl::nid::Nid;
use openssl::x509::{X509Req, X509}; use openssl::x509::X509Req;
use std::collections::HashSet; use std::str::FromStr;
#[derive(Debug, serde::Deserialize)] #[derive(Debug, serde::Deserialize)]
pub struct EnrollRequest { pub struct EnrollRequest {
@@ -128,80 +130,40 @@ pub async fn get_certificate(query: web::Query<ReqWithDevID>, actor: WebEnergyAc
.body(cert)) .body(cert))
} }
#[derive(serde::Deserialize)] #[derive(Debug, Clone, serde::Serialize, serde::Deserialize)]
pub struct SyncRequest {
payload: String,
}
#[derive(Debug, serde::Serialize, serde::Deserialize)]
struct Claims { struct Claims {
info: DeviceInfo, info: DeviceInfo,
} }
#[derive(serde::Serialize)]
struct SyncResult {
relays: Vec<RelaySyncStatus>,
available_update: Option<semver::Version>,
}
/// Synchronize device /// Synchronize device
pub async fn sync_device(body: web::Json<SyncRequest>, actor: WebEnergyActor) -> HttpResult { pub async fn sync_device(body: web::Json<JWTRequest>, actor: WebEnergyActor) -> HttpResult {
// First, we need to extract device kid from query let (device, claims) = body.0.parse_jwt::<Claims>(actor.clone()).await?;
let Ok(jwt_header) = jsonwebtoken::decode_header(&body.payload) else {
log::error!("Failed to decode JWT header!");
return Ok(HttpResponse::BadRequest().json("Failed to decode JWT header!"));
};
let Some(kid) = jwt_header.kid else { let relays = actor
log::error!("Missing KID in JWT!"); .send(energy_actor::SynchronizeDevice(
return Ok(HttpResponse::BadRequest().json("Missing KID in JWT!")); device.id,
}; claims.info.clone(),
))
// Fetch device information
let Some(device) = actor
.send(energy_actor::GetSingleDevice(DeviceId(kid)))
.await?
else {
log::error!("Sent a JWT for a device which does not exists!");
return Ok(HttpResponse::NotFound().json("Sent a JWT for a device which does not exists!"));
};
if !device.validated {
log::error!("Sent a JWT for a device which is not validated!");
return Ok(HttpResponse::PreconditionFailed()
.json("Sent a JWT for a device which is not validated!"));
}
// Check certificate revocation status
let cert_bytes = std::fs::read(AppConfig::get().device_cert_path(&device.id))?;
let certificate = X509::from_pem(&cert_bytes)?;
if pki::CertData::load_devices_ca()?.is_revoked(&certificate)? {
log::error!("Sent a JWT using a revoked certificate!");
return Ok(
HttpResponse::PreconditionFailed().json("Sent a JWT using a revoked certificate!")
);
}
let (key, alg) = match DecodingKey::from_ec_pem(&cert_bytes) {
Ok(key) => (key, Algorithm::ES256),
Err(e) => {
log::warn!("Failed to decode certificate as EC certificate {e}, trying RSA...");
(
DecodingKey::from_rsa_pem(&cert_bytes).expect("Failed to decode RSA certificate"),
Algorithm::RS256,
)
}
};
let mut validation = Validation::new(alg);
validation.validate_exp = false;
validation.required_spec_claims = HashSet::default();
let c = match jsonwebtoken::decode::<Claims>(&body.payload, &key, &validation) {
Ok(c) => c,
Err(e) => {
log::error!("Failed to validate JWT! {e}");
return Ok(HttpResponse::PreconditionFailed().json("Failed to validate JWT!"));
}
};
let res = actor
.send(energy_actor::SynchronizeDevice(device.id, c.claims.info))
.await??; .await??;
Ok(HttpResponse::Ok().json(res)) let mut available_update = None;
// Check if the version is available
if let Some(desired) = device.desired_version
&& claims.info.version < desired
&& ota_manager::update_exists(OTAPlatform::from_str(&claims.info.reference)?, &desired)?
{
available_update = Some(desired);
}
Ok(HttpResponse::Ok().json(SyncResult {
relays,
available_update,
}))
} }

View File

@@ -1,2 +1,5 @@
pub mod device_logging_controller;
pub mod devices_ota;
pub mod jwt_parser;
pub mod mgmt_controller; pub mod mgmt_controller;
pub mod utils_controller; pub mod utils_controller;

View File

@@ -3,31 +3,34 @@ use crate::constants;
use crate::crypto::pki; use crate::crypto::pki;
use crate::energy::energy_actor::EnergyActorAddr; use crate::energy::energy_actor::EnergyActorAddr;
use crate::server::auth_middleware::AuthChecker; use crate::server::auth_middleware::AuthChecker;
use crate::server::devices_api::{mgmt_controller, utils_controller}; use crate::server::devices_api::{
device_logging_controller, devices_ota, mgmt_controller, utils_controller,
};
use crate::server::unsecure_server::*; use crate::server::unsecure_server::*;
use crate::server::web_api::*; use crate::server::web_api::*;
use crate::server::web_app_controller; use crate::server::web_app_controller;
use actix_cors::Cors; use actix_cors::Cors;
use actix_identity::config::LogoutBehaviour;
use actix_identity::IdentityMiddleware; use actix_identity::IdentityMiddleware;
use actix_identity::config::LogoutBehavior;
use actix_remote_ip::RemoteIPConfig; use actix_remote_ip::RemoteIPConfig;
use actix_session::storage::CookieSessionStore;
use actix_session::SessionMiddleware; use actix_session::SessionMiddleware;
use actix_session::storage::CookieSessionStore;
use actix_web::cookie::{Key, SameSite}; use actix_web::cookie::{Key, SameSite};
use actix_web::middleware::Logger; use actix_web::middleware::Logger;
use actix_web::{web, App, HttpServer}; use actix_web::{App, HttpServer, web};
use openssl::ssl::{SslAcceptor, SslMethod}; use openssl::ssl::{SslAcceptor, SslMethod};
use std::time::Duration; use std::time::Duration;
/// Start unsecure (HTTP) server /// Start unsecure (HTTP) server
pub async fn unsecure_server() -> anyhow::Result<()> { pub async fn unsecure_server(energy_actor: EnergyActorAddr) -> anyhow::Result<()> {
log::info!( log::info!(
"Unsecure server starting to listen on {} for {}", "Unsecure server starting to listen on {} for {}",
AppConfig::get().unsecure_listen_address, AppConfig::get().unsecure_listen_address,
AppConfig::get().unsecure_origin() AppConfig::get().unsecure_origin()
); );
HttpServer::new(|| { HttpServer::new(move || {
App::new() App::new()
.app_data(web::Data::new(energy_actor.clone()))
.wrap(Logger::default()) .wrap(Logger::default())
.route( .route(
"/", "/",
@@ -41,6 +44,10 @@ pub async fn unsecure_server() -> anyhow::Result<()> {
"/pki/{file}", "/pki/{file}",
web::get().to(unsecure_pki_controller::serve_pki_file), web::get().to(unsecure_pki_controller::serve_pki_file),
) )
.route(
"/relay/{id}/legacy_state",
web::get().to(unsecure_relay_controller::legacy_state),
)
}) })
.bind(&AppConfig::get().unsecure_listen_address)? .bind(&AppConfig::get().unsecure_listen_address)?
.run() .run()
@@ -77,7 +84,7 @@ pub async fn secure_server(energy_actor: EnergyActorAddr) -> anyhow::Result<()>
.build(); .build();
let identity_middleware = IdentityMiddleware::builder() let identity_middleware = IdentityMiddleware::builder()
.logout_behaviour(LogoutBehaviour::PurgeSession) .logout_behavior(LogoutBehavior::PurgeSession)
.visit_deadline(Some(Duration::from_secs( .visit_deadline(Some(Duration::from_secs(
constants::MAX_INACTIVITY_DURATION, constants::MAX_INACTIVITY_DURATION,
))) )))
@@ -131,10 +138,22 @@ pub async fn secure_server(energy_actor: EnergyActorAddr) -> anyhow::Result<()>
"/web_api/energy/curr_consumption", "/web_api/energy/curr_consumption",
web::get().to(energy_controller::curr_consumption), web::get().to(energy_controller::curr_consumption),
) )
.route(
"/web_api/energy/curr_consumption/history",
web::get().to(energy_controller::curr_consumption_history),
)
.route( .route(
"/web_api/energy/cached_consumption", "/web_api/energy/cached_consumption",
web::get().to(energy_controller::cached_consumption), web::get().to(energy_controller::cached_consumption),
) )
.route(
"/web_api/energy/relays_consumption",
web::get().to(energy_controller::relays_consumption),
)
.route(
"/web_api/energy/relays_consumption/history",
web::get().to(energy_controller::relays_consumption_history),
)
// Devices controller // Devices controller
.route( .route(
"/web_api/devices/list_pending", "/web_api/devices/list_pending",
@@ -168,6 +187,37 @@ pub async fn secure_server(energy_actor: EnergyActorAddr) -> anyhow::Result<()>
"/web_api/device/{id}", "/web_api/device/{id}",
web::delete().to(devices_controller::delete_device), web::delete().to(devices_controller::delete_device),
) )
// OTA API
.route(
"/web_api/ota/supported_platforms",
web::get().to(ota_controller::supported_platforms),
)
.route(
"/web_api/ota/{platform}/{version}",
web::post().to(ota_controller::upload_firmware),
)
.route(
"/web_api/ota/{platform}/{version}",
web::get().to(ota_controller::download_firmware),
)
.route(
"/web_api/ota/{platform}/{version}",
web::delete().to(ota_controller::delete_update),
)
.route("/web_api/ota", web::get().to(ota_controller::list_all_ota))
.route(
"/web_api/ota/{platform}",
web::get().to(ota_controller::list_updates_platform),
)
.route(
"/web_api/ota/set_desired_version",
web::post().to(ota_controller::set_desired_version),
)
// Logging controller API
.route(
"/web_api/logging/logs",
web::get().to(logging_controller::get_log),
)
// Relays API // Relays API
.route( .route(
"/web_api/relays/list", "/web_api/relays/list",
@@ -181,10 +231,27 @@ pub async fn secure_server(energy_actor: EnergyActorAddr) -> anyhow::Result<()>
"/web_api/relay/{id}", "/web_api/relay/{id}",
web::put().to(relays_controller::update), web::put().to(relays_controller::update),
) )
.route(
"/web_api/relay/{id}/forced_state",
web::put().to(relays_controller::set_forced_state),
)
.route( .route(
"/web_api/relay/{id}", "/web_api/relay/{id}",
web::delete().to(relays_controller::delete), web::delete().to(relays_controller::delete),
) )
.route(
"/web_api/relays/status",
web::get().to(relays_controller::status_all),
)
.route(
"/web_api/relay/{id}/status",
web::get().to(relays_controller::status_single),
)
// Management API
.route(
"/web_api/management/download_storage",
web::get().to(management_controller::download_storage),
)
// Devices API // Devices API
.route( .route(
"/devices_api/utils/time", "/devices_api/utils/time",
@@ -206,6 +273,14 @@ pub async fn secure_server(energy_actor: EnergyActorAddr) -> anyhow::Result<()>
"/devices_api/mgmt/sync", "/devices_api/mgmt/sync",
web::post().to(mgmt_controller::sync_device), web::post().to(mgmt_controller::sync_device),
) )
.route(
"/devices_api/ota/{platform}/{version}",
web::get().to(devices_ota::retrieve_firmware),
)
.route(
"/devices_api/logging/record",
web::post().to(device_logging_controller::report_log),
)
// Web app // Web app
.route("/", web::get().to(web_app_controller::root_index)) .route("/", web::get().to(web_app_controller::root_index))
.route( .route(

View File

@@ -1,2 +1,3 @@
pub mod unsecure_pki_controller; pub mod unsecure_pki_controller;
pub mod unsecure_relay_controller;
pub mod unsecure_server_controller; pub mod unsecure_server_controller;

View File

@@ -1,6 +1,6 @@
use crate::app_config::AppConfig; use crate::app_config::AppConfig;
use crate::server::custom_error::HttpResult; use crate::server::custom_error::HttpResult;
use actix_web::{web, HttpResponse}; use actix_web::{HttpResponse, web};
#[derive(serde::Deserialize)] #[derive(serde::Deserialize)]
pub struct ServeCRLPath { pub struct ServeCRLPath {

View File

@@ -0,0 +1,60 @@
use crate::devices::device::DeviceRelayID;
use crate::energy::{energy_actor, relay_state_history};
use crate::server::WebEnergyActor;
use crate::server::custom_error::HttpResult;
use actix_web::{HttpResponse, web};
#[derive(serde::Deserialize)]
pub struct LegacyStateRelay {
id: DeviceRelayID,
}
/// Legacy relay state
#[derive(serde::Serialize)]
pub struct LegacyState {
/// Indicates if relay is on or off
is_on: bool,
/// Relay name
name: String,
/// Duration since last change of state
r#for: usize,
/// Current grid consumption
prod: i32,
/// Total uptime since last reset
total_uptime: usize,
/// Required uptime during a day
///
/// Will be 0 if there is no daily requirements
required_uptime: usize,
}
/// Get the state of a relay, adapted for old system components
pub async fn legacy_state(
energy_actor: WebEnergyActor,
path: web::Path<LegacyStateRelay>,
) -> HttpResult {
let Some(relay) = energy_actor
.send(energy_actor::GetSingleRelay(path.id))
.await?
else {
return Ok(HttpResponse::NotFound().body("Relay not found!"));
};
let all_states = energy_actor.send(energy_actor::GetAllRelaysState).await?;
let Some(state) = all_states.into_iter().find(|r| r.id == path.id) else {
return Ok(HttpResponse::InternalServerError().body("Relay status unavailable!"));
};
let production = energy_actor.send(energy_actor::GetCurrConsumption).await?;
let total_uptime = relay_state_history::relay_total_runtime_adjusted(&relay);
Ok(HttpResponse::Ok().json(LegacyState {
name: relay.name,
is_on: state.on,
r#for: state.r#for.min(3600 * 24 * 7),
prod: production,
total_uptime,
required_uptime: relay.daily_runtime.map(|r| r.min_runtime).unwrap_or(0),
}))
}

View File

@@ -2,7 +2,7 @@ use crate::app_config::AppConfig;
use crate::server::custom_error::HttpResult; use crate::server::custom_error::HttpResult;
use actix_identity::Identity; use actix_identity::Identity;
use actix_remote_ip::RemoteIP; use actix_remote_ip::RemoteIP;
use actix_web::{web, HttpMessage, HttpRequest, HttpResponse}; use actix_web::{HttpMessage, HttpRequest, HttpResponse, web};
#[derive(serde::Deserialize)] #[derive(serde::Deserialize)]
pub struct AuthRequest { pub struct AuthRequest {
@@ -17,11 +17,11 @@ pub async fn password_auth(
remote_ip: RemoteIP, remote_ip: RemoteIP,
) -> HttpResult { ) -> HttpResult {
if r.user != AppConfig::get().admin_username || r.password != AppConfig::get().admin_password { if r.user != AppConfig::get().admin_username || r.password != AppConfig::get().admin_password {
log::error!("Failed login attempt from {}!", remote_ip.0.to_string()); log::error!("Failed login attempt from {}!", remote_ip.0);
return Ok(HttpResponse::Unauthorized().json("Invalid credentials!")); return Ok(HttpResponse::Unauthorized().json("Invalid credentials!"));
} }
log::info!("Successful login attempt from {}!", remote_ip.0.to_string()); log::info!("Successful login attempt from {}!", remote_ip.0);
Identity::login(&request.extensions(), r.user.to_string())?; Identity::login(&request.extensions(), r.user.to_string())?;
Ok(HttpResponse::Ok().finish()) Ok(HttpResponse::Ok().finish())
} }

View File

@@ -1,8 +1,8 @@
use crate::devices::device::{DeviceGeneralInfo, DeviceId}; use crate::devices::device::{DeviceGeneralInfo, DeviceId};
use crate::energy::energy_actor; use crate::energy::energy_actor;
use crate::server::custom_error::HttpResult;
use crate::server::WebEnergyActor; use crate::server::WebEnergyActor;
use actix_web::{web, HttpResponse}; use crate::server::custom_error::HttpResult;
use actix_web::{HttpResponse, web};
/// Get the list of pending (not accepted yet) devices /// Get the list of pending (not accepted yet) devices
pub async fn list_pending(actor: WebEnergyActor) -> HttpResult { pub async fn list_pending(actor: WebEnergyActor) -> HttpResult {

View File

@@ -1,23 +1,66 @@
use crate::app_config::ConsumptionHistoryType;
use crate::energy::consumption::EnergyConsumption;
use crate::energy::consumption_history_file::ConsumptionHistoryFile;
use crate::energy::{consumption, energy_actor}; use crate::energy::{consumption, energy_actor};
use crate::server::custom_error::HttpResult;
use crate::server::WebEnergyActor; use crate::server::WebEnergyActor;
use crate::server::custom_error::HttpResult;
use crate::utils::time_utils::time_secs;
use actix_web::HttpResponse; use actix_web::HttpResponse;
#[derive(serde::Serialize)] #[derive(serde::Serialize)]
struct Consumption { struct Consumption {
consumption: i32, consumption: Option<i32>,
} }
/// Get current energy consumption /// Get current energy consumption
pub async fn curr_consumption() -> HttpResult { pub async fn curr_consumption() -> HttpResult {
let consumption = consumption::get_curr_consumption().await?; Ok(match consumption::get_curr_consumption().await {
Ok(v) => HttpResponse::Ok().json(Consumption {
consumption: Some(v),
}),
Err(e) => {
log::error!("Failed to fetch current consumption! {e}");
HttpResponse::Ok().json(Consumption { consumption: None })
}
})
}
Ok(HttpResponse::Ok().json(Consumption { consumption })) /// Get curr consumption history
pub async fn curr_consumption_history() -> HttpResult {
let history = ConsumptionHistoryFile::get_history(
ConsumptionHistoryType::GridConsumption,
time_secs() - 3600 * 24,
time_secs(),
60 * 10,
)?;
Ok(HttpResponse::Ok().json(history))
} }
/// Get cached energy consumption /// Get cached energy consumption
pub async fn cached_consumption(energy_actor: WebEnergyActor) -> HttpResult { pub async fn cached_consumption(energy_actor: WebEnergyActor) -> HttpResult {
let consumption = energy_actor.send(energy_actor::GetCurrConsumption).await?; let consumption = energy_actor.send(energy_actor::GetCurrConsumption).await?;
Ok(HttpResponse::Ok().json(Consumption { consumption })) Ok(HttpResponse::Ok().json(Consumption {
consumption: Some(consumption),
}))
}
/// Get current relays consumption
pub async fn relays_consumption(energy_actor: WebEnergyActor) -> HttpResult {
let consumption =
energy_actor.send(energy_actor::RelaysConsumption).await? as EnergyConsumption;
Ok(HttpResponse::Ok().json(Consumption {
consumption: Some(consumption),
}))
}
pub async fn relays_consumption_history() -> HttpResult {
let history = ConsumptionHistoryFile::get_history(
ConsumptionHistoryType::RelayConsumption,
time_secs() - 3600 * 24,
time_secs(),
60 * 10,
)?;
Ok(HttpResponse::Ok().json(history))
} }

View File

@@ -0,0 +1,30 @@
use crate::devices::device::DeviceId;
use crate::logs::logs_manager;
use crate::logs::severity::LogSeverity;
use crate::server::custom_error::HttpResult;
use crate::utils::time_utils::curr_day_number;
use actix_web::{HttpResponse, web};
#[derive(serde::Deserialize)]
pub struct LogRequest {
// Day number
day: Option<u64>,
min_severity: Option<LogSeverity>,
device: Option<DeviceId>,
}
/// Get some logs
pub async fn get_log(req: web::Query<LogRequest>) -> HttpResult {
let day = req.day.unwrap_or_else(curr_day_number);
let mut logs = logs_manager::get_logs(day)?;
if let Some(min_severity) = req.min_severity {
logs.retain(|d| d.severity >= min_severity);
}
if let Some(dev_id) = &req.device {
logs.retain(|d| d.device_id.as_ref() == Some(dev_id));
}
Ok(HttpResponse::Ok().json(logs))
}

View File

@@ -0,0 +1,66 @@
use crate::app_config::AppConfig;
use crate::server::custom_error::HttpResult;
use crate::utils::time_utils::current_day;
use actix_web::HttpResponse;
use anyhow::Context;
use std::fs::File;
use std::io::{Cursor, Read, Write};
use walkdir::WalkDir;
use zip::write::SimpleFileOptions;
/// Download a full copy of the storage data
pub async fn download_storage() -> HttpResult {
let mut zip_buff = Cursor::new(Vec::new());
let mut zip = zip::ZipWriter::new(&mut zip_buff);
let options = SimpleFileOptions::default()
.compression_method(zip::CompressionMethod::Bzip2)
.unix_permissions(0o700);
let storage = AppConfig::get().storage_path();
let mut file_buff = Vec::new();
for entry in WalkDir::new(&storage) {
let entry = entry?;
let path = entry.path();
let name = path.strip_prefix(&storage).unwrap();
let path_as_string = name
.to_str()
.map(str::to_owned)
.with_context(|| format!("{name:?} Is a Non UTF-8 Path"))?;
// Write file or directory explicitly
// Some unzip tools unzip files with directory paths correctly, some do not!
if path.is_file() {
log::debug!("adding file {path:?} as {name:?} ...");
zip.start_file(path_as_string, options)?;
let mut f = File::open(path)?;
f.read_to_end(&mut file_buff)?;
zip.write_all(&file_buff)?;
file_buff.clear();
} else if !name.as_os_str().is_empty() {
// Only if not root! Avoids path spec / warning
// and mapname conversion failed error on unzip
log::debug!("adding dir {path_as_string:?} as {name:?} ...");
zip.add_directory(path_as_string, options)?;
}
}
// Inject runtime configuration
zip.start_file("/app_config.json", options)?;
zip.write_all(&serde_json::to_vec_pretty(&AppConfig::get())?)?;
zip.finish()?;
let filename = format!("storage-{}.zip", current_day());
Ok(HttpResponse::Ok()
.content_type("application/zip")
.insert_header((
"content-disposition",
format!("attachment; filename=\"{filename}\""),
))
.body(zip_buff.into_inner()))
}

View File

@@ -1,5 +1,8 @@
pub mod auth_controller; pub mod auth_controller;
pub mod devices_controller; pub mod devices_controller;
pub mod energy_controller; pub mod energy_controller;
pub mod logging_controller;
pub mod management_controller;
pub mod ota_controller;
pub mod relays_controller; pub mod relays_controller;
pub mod server_controller; pub mod server_controller;

View File

@@ -0,0 +1,148 @@
use crate::constants;
use crate::devices::device::DeviceId;
use crate::energy::energy_actor;
use crate::ota::ota_manager;
use crate::ota::ota_update::OTAPlatform;
use crate::server::WebEnergyActor;
use crate::server::custom_error::HttpResult;
use actix_multipart::form::MultipartForm;
use actix_multipart::form::tempfile::TempFile;
use actix_web::{HttpResponse, web};
pub async fn supported_platforms() -> HttpResult {
Ok(HttpResponse::Ok().json(OTAPlatform::supported_platforms()))
}
#[derive(Debug, MultipartForm)]
pub struct UploadForm {
#[multipart(rename = "firmware")]
firmware: Vec<TempFile>,
}
#[derive(serde::Deserialize)]
pub struct SpecificOTAVersionPath {
platform: OTAPlatform,
version: semver::Version,
}
/// Upload a new firmware update
pub async fn upload_firmware(
MultipartForm(form): MultipartForm<UploadForm>,
path: web::Path<SpecificOTAVersionPath>,
) -> HttpResult {
if ota_manager::update_exists(path.platform, &path.version)? {
return Ok(HttpResponse::Conflict()
.json("A firmware with the same version has already been uploaded on the platform!"));
}
let Some(file) = form.firmware.first() else {
return Ok(HttpResponse::BadRequest().json("No firmware specified!"));
};
if file.size == 0 {
return Ok(HttpResponse::BadRequest().json("Uploaded file is empty!"));
}
if file.size > constants::MAX_FIRMWARE_SIZE {
return Ok(HttpResponse::BadRequest().json("Uploaded file is too heavy!"));
}
let content = std::fs::read(file.file.path())?;
ota_manager::save_update(path.platform, &path.version, &content)?;
Ok(HttpResponse::Accepted().body("OTA update successfully saved."))
}
/// Download a firmware update
pub async fn download_firmware(path: web::Path<SpecificOTAVersionPath>) -> HttpResult {
if !ota_manager::update_exists(path.platform, &path.version)? {
return Ok(HttpResponse::NotFound().json("The requested firmware update was not found!"));
}
let firmware = ota_manager::get_ota_update(path.platform, &path.version)?;
Ok(HttpResponse::Ok()
.content_type("application/octet-stream")
.append_header((
"content-disposition",
format!(
"attachment; filename=\"{}-{}.bin\"",
path.platform, path.version
),
))
.body(firmware))
}
/// Delete an uploaded firmware update
pub async fn delete_update(path: web::Path<SpecificOTAVersionPath>) -> HttpResult {
if !ota_manager::update_exists(path.platform, &path.version)? {
return Ok(HttpResponse::NotFound().json("The requested firmware update was not found!"));
}
ota_manager::delete_update(path.platform, &path.version)?;
Ok(HttpResponse::Accepted().finish())
}
/// Get the list of all OTA updates
pub async fn list_all_ota() -> HttpResult {
Ok(HttpResponse::Ok().json(ota_manager::get_all_ota_updates()?))
}
#[derive(serde::Deserialize)]
pub struct ListOTAPath {
platform: OTAPlatform,
}
/// List OTA software updates for a given platform
pub async fn list_updates_platform(path: web::Path<ListOTAPath>) -> HttpResult {
let list = ota_manager::get_ota_updates_for_platform(path.platform)?;
Ok(HttpResponse::Ok().json(list))
}
#[derive(serde::Deserialize)]
pub struct SetDesiredDeviceVersion {
devices: Option<Vec<DeviceId>>,
platform: Option<OTAPlatform>,
version: semver::Version,
}
pub async fn set_desired_version(
actor: WebEnergyActor,
body: web::Json<SetDesiredDeviceVersion>,
) -> HttpResult {
if body.devices.is_none() && body.platform.is_none() {
return Ok(
HttpResponse::BadRequest().json("Must specify one filter to select target devices!")
);
}
let devices = actor.send(energy_actor::GetDeviceLists).await?;
for d in devices {
// Filter per platform
if let Some(p) = body.platform
&& d.info.reference != p.to_string()
{
continue;
}
// Filter per device
if let Some(ids) = &body.devices
&& !ids.contains(&d.id)
{
continue;
}
actor
.send(energy_actor::SetDesiredVersion(
d.id,
Some(body.version.clone()),
))
.await??;
}
Ok(HttpResponse::Ok().finish())
}

View File

@@ -1,8 +1,9 @@
use crate::devices::device::{DeviceId, DeviceRelay, DeviceRelayID}; use crate::devices::device::{DeviceId, DeviceRelay, DeviceRelayID};
use crate::energy::energy_actor; use crate::energy::energy_actor;
use crate::server::custom_error::HttpResult; use crate::energy::engine::SetRelayForcedStateReq;
use crate::server::WebEnergyActor; use crate::server::WebEnergyActor;
use actix_web::{web, HttpResponse}; use crate::server::custom_error::HttpResult;
use actix_web::{HttpResponse, web};
/// Get the full list of relays /// Get the full list of relays
pub async fn get_list(actor: WebEnergyActor) -> HttpResult { pub async fn get_list(actor: WebEnergyActor) -> HttpResult {
@@ -85,6 +86,29 @@ pub async fn update(
Ok(HttpResponse::Accepted().finish()) Ok(HttpResponse::Accepted().finish())
} }
/// Set relay forced status
pub async fn set_forced_state(
actor: WebEnergyActor,
req: web::Json<SetRelayForcedStateReq>,
path: web::Path<RelayIDInPath>,
) -> HttpResult {
// Check if relay exists first
let list = actor.send(energy_actor::GetAllRelaysState).await?;
if !list.into_iter().any(|r| r.id == path.id) {
return Ok(HttpResponse::NotFound().json("Relay not found!"));
};
// Update relay forced state
actor
.send(energy_actor::SetRelayForcedState(
path.id,
req.to_forced_state(),
))
.await??;
Ok(HttpResponse::Accepted().finish())
}
/// Delete an existing relay /// Delete an existing relay
pub async fn delete(actor: WebEnergyActor, path: web::Path<RelayIDInPath>) -> HttpResult { pub async fn delete(actor: WebEnergyActor, path: web::Path<RelayIDInPath>) -> HttpResult {
actor actor
@@ -93,3 +117,20 @@ pub async fn delete(actor: WebEnergyActor, path: web::Path<RelayIDInPath>) -> Ht
Ok(HttpResponse::Accepted().finish()) Ok(HttpResponse::Accepted().finish())
} }
/// Get the status of all relays
pub async fn status_all(actor: WebEnergyActor) -> HttpResult {
let list = actor.send(energy_actor::GetAllRelaysState).await?;
Ok(HttpResponse::Ok().json(list))
}
/// Get the state of a single relay
pub async fn status_single(actor: WebEnergyActor, path: web::Path<RelayIDInPath>) -> HttpResult {
let list = actor.send(energy_actor::GetAllRelaysState).await?;
let Some(state) = list.into_iter().find(|r| r.id == path.id) else {
return Ok(HttpResponse::NotFound().json("Relay not found!"));
};
Ok(HttpResponse::Ok().json(state))
}

View File

@@ -12,6 +12,11 @@ pub async fn secure_home() -> HttpResponse {
struct ServerConfig { struct ServerConfig {
auth_disabled: bool, auth_disabled: bool,
constraints: StaticConstraints, constraints: StaticConstraints,
unsecure_origin: String,
backend_version: &'static str,
dashboard_custom_current_consumption_title: Option<&'static str>,
dashboard_custom_relays_consumption_title: Option<&'static str>,
dashboard_custom_cached_consumption_title: Option<&'static str>,
} }
impl Default for ServerConfig { impl Default for ServerConfig {
@@ -19,6 +24,17 @@ impl Default for ServerConfig {
Self { Self {
auth_disabled: AppConfig::get().unsecure_disable_login, auth_disabled: AppConfig::get().unsecure_disable_login,
constraints: Default::default(), constraints: Default::default(),
unsecure_origin: AppConfig::get().unsecure_origin(),
backend_version: env!("CARGO_PKG_VERSION"),
dashboard_custom_current_consumption_title: AppConfig::get()
.dashboard_custom_current_consumption_title
.as_deref(),
dashboard_custom_relays_consumption_title: AppConfig::get()
.dashboard_custom_relays_consumption_title
.as_deref(),
dashboard_custom_cached_consumption_title: AppConfig::get()
.dashboard_custom_cached_consumption_title
.as_deref(),
} }
} }
} }

View File

@@ -19,7 +19,7 @@ mod serve_static_debug {
#[cfg(not(debug_assertions))] #[cfg(not(debug_assertions))]
mod serve_static_release { mod serve_static_release {
use actix_web::{web, HttpResponse, Responder}; use actix_web::{HttpResponse, Responder, web};
use rust_embed::RustEmbed; use rust_embed::RustEmbed;
#[derive(RustEmbed)] #[derive(RustEmbed)]

View File

@@ -0,0 +1,8 @@
use std::ops::Div;
pub fn median<E: Div + Copy + Ord>(numbers: &[E]) -> E {
let mut numbers = numbers.to_vec();
numbers.sort();
let mid = numbers.len() / 2;
numbers[mid]
}

View File

@@ -1,2 +1,3 @@
pub mod files_utils; pub mod files_utils;
pub mod math_utils;
pub mod time_utils; pub mod time_utils;

View File

@@ -1,7 +1,7 @@
use chrono::prelude::*; use chrono::prelude::*;
use std::time::{SystemTime, UNIX_EPOCH}; use std::time::{SystemTime, UNIX_EPOCH};
/// Get the current time since epoch /// Get the current time since epoch, in seconds
pub fn time_secs() -> u64 { pub fn time_secs() -> u64 {
SystemTime::now() SystemTime::now()
.duration_since(UNIX_EPOCH) .duration_since(UNIX_EPOCH)
@@ -22,6 +22,11 @@ pub fn day_number(time: u64) -> u64 {
time / (3600 * 24) time / (3600 * 24)
} }
/// Get current day number
pub fn curr_day_number() -> u64 {
day_number(time_secs())
}
/// Get current hour, 00 => 23 (local time) /// Get current hour, 00 => 23 (local time)
pub fn curr_hour() -> u32 { pub fn curr_hour() -> u32 {
let local: DateTime<Local> = Local::now(); let local: DateTime<Local> = Local::now();
@@ -36,6 +41,12 @@ pub fn time_start_of_day() -> anyhow::Result<u64> {
Ok(local.timestamp() as u64) Ok(local.timestamp() as u64)
} }
/// Get formatted string containing current day information
pub fn current_day() -> String {
let dt = Local::now();
format!("{}-{:0>2}-{:0>2}", dt.year(), dt.month(), dt.day())
}
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use crate::utils::time_utils::day_number; use crate::utils::time_utils::day_number;

View File

@@ -1,30 +0,0 @@
# React + TypeScript + Vite
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.
Currently, two official plugins are available:
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh
## Expanding the ESLint configuration
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:
- Configure the top-level `parserOptions` property like this:
```js
export default {
// other rules...
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
}
```
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list

View File

@@ -0,0 +1,28 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'
export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
)

View File

@@ -2,7 +2,7 @@
<html lang="en"> <html lang="en">
<head> <head>
<meta charset="UTF-8" /> <meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/sunny.svg" /> <link rel="icon" type="image/svg+xml" href="/assets/sunny.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>SolarEnergy</title> <title>SolarEnergy</title>
</head> </head>

File diff suppressed because it is too large Load Diff

View File

@@ -6,35 +6,40 @@
"scripts": { "scripts": {
"dev": "vite", "dev": "vite",
"build": "tsc -b && vite build", "build": "tsc -b && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0", "lint": "eslint .",
"preview": "vite preview" "preview": "vite preview"
}, },
"dependencies": { "dependencies": {
"@emotion/react": "^11.13.3", "@emotion/react": "^11.14.0",
"@emotion/styled": "^11.13.0", "@emotion/styled": "^11.14.1",
"@fontsource/roboto": "^5.1.0", "@fontsource/roboto": "^5.2.9",
"@mdi/js": "^7.4.47", "@mdi/js": "^7.4.47",
"@mdi/react": "^1.6.1", "@mdi/react": "^1.6.1",
"@mui/icons-material": "^6.1.1", "@mui/icons-material": "^7.3.5",
"@mui/material": "^6.1.1", "@mui/material": "^7.3.5",
"@mui/x-charts": "^7.18.0", "@mui/x-charts": "^8.20.0",
"@mui/x-date-pickers": "^7.18.0", "@mui/x-date-pickers": "^8.19.0",
"date-and-time": "^3.5.0", "date-and-time": "^4.1.1",
"dayjs": "^1.11.13", "dayjs": "^1.11.19",
"react": "^18.3.1", "filesize": "^11.0.13",
"react-dom": "^18.3.1", "react": "^19.2.0",
"react-router-dom": "^6.26.2" "react-dom": "^19.2.0",
"react-router-dom": "^7.9.6",
"semver": "^7.7.3"
}, },
"devDependencies": { "devDependencies": {
"@types/react": "^18.3.8", "@types/react": "^19.2.7",
"@types/react-dom": "^18.3.0", "@types/react-dom": "^19.2.3",
"@typescript-eslint/eslint-plugin": "^8.6.0", "@types/semver": "^7.7.1",
"@typescript-eslint/parser": "^8.6.0", "@typescript-eslint/eslint-plugin": "^8.48.0",
"@vitejs/plugin-react": "^4.3.1", "@typescript-eslint/parser": "^8.48.0",
"eslint": "^8.57.1", "@vitejs/plugin-react": "^5.1.1",
"eslint-plugin-react-hooks": "^4.6.2", "eslint": "^9.39.1",
"eslint-plugin-react-refresh": "^0.4.12", "eslint-plugin-react-hooks": "^7.0.1",
"typescript": "^5.6.2", "eslint-plugin-react-refresh": "^0.4.24",
"vite": "^5.4.7" "globals": "^16.5.0",
"typescript": "^5.9.3",
"typescript-eslint": "^8.48.0",
"vite": "^7.1.12"
} }
} }

View File

Before

Width:  |  Height:  |  Size: 407 KiB

After

Width:  |  Height:  |  Size: 407 KiB

View File

Before

Width:  |  Height:  |  Size: 557 B

After

Width:  |  Height:  |  Size: 557 B

View File

@@ -10,10 +10,13 @@ import { DeviceRoute } from "./routes/DeviceRoute/DeviceRoute";
import { DevicesRoute } from "./routes/DevicesRoute"; import { DevicesRoute } from "./routes/DevicesRoute";
import { HomeRoute } from "./routes/HomeRoute"; import { HomeRoute } from "./routes/HomeRoute";
import { LoginRoute } from "./routes/LoginRoute"; import { LoginRoute } from "./routes/LoginRoute";
import { LogsRoute } from "./routes/LogsRoute";
import { NotFoundRoute } from "./routes/NotFoundRoute"; import { NotFoundRoute } from "./routes/NotFoundRoute";
import { PendingDevicesRoute } from "./routes/PendingDevicesRoute"; import { PendingDevicesRoute } from "./routes/PendingDevicesRoute";
import { RelaysListRoute } from "./routes/RelaysListRoute"; import { RelaysListRoute } from "./routes/RelaysListRoute";
import { BaseAuthenticatedPage } from "./widgets/BaseAuthenticatedPage"; import { BaseAuthenticatedPage } from "./widgets/BaseAuthenticatedPage";
import { OTARoute } from "./routes/OTARoute";
import { ManagementRoute } from "./routes/ManagementRoute";
export function App() { export function App() {
if (!AuthApi.SignedIn && !ServerApi.Config.auth_disabled) if (!AuthApi.SignedIn && !ServerApi.Config.auth_disabled)
@@ -27,6 +30,9 @@ export function App() {
<Route path="devices" element={<DevicesRoute />} /> <Route path="devices" element={<DevicesRoute />} />
<Route path="dev/:id" element={<DeviceRoute />} /> <Route path="dev/:id" element={<DeviceRoute />} />
<Route path="relays" element={<RelaysListRoute />} /> <Route path="relays" element={<RelaysListRoute />} />
<Route path="ota" element={<OTARoute />} />
<Route path="logs" element={<LogsRoute />} />
<Route path="management" element={<ManagementRoute />} />
<Route path="*" element={<NotFoundRoute />} /> <Route path="*" element={<NotFoundRoute />} />
</Route> </Route>
) )

View File

@@ -37,6 +37,7 @@ export interface Device {
validated: boolean; validated: boolean;
enabled: boolean; enabled: boolean;
relays: DeviceRelay[]; relays: DeviceRelay[];
desired_version?: string;
} }
export interface UpdatedInfo { export interface UpdatedInfo {

View File

@@ -2,9 +2,9 @@ import { APIClient } from "./ApiClient";
export class EnergyApi { export class EnergyApi {
/** /**
* Get current house consumption * Get current grid consumption
*/ */
static async CurrConsumption(): Promise<number> { static async GridConsumption(): Promise<number> {
const data = await APIClient.exec({ const data = await APIClient.exec({
method: "GET", method: "GET",
uri: "/energy/curr_consumption", uri: "/energy/curr_consumption",
@@ -12,6 +12,18 @@ export class EnergyApi {
return data.data.consumption; return data.data.consumption;
} }
/**
* Get grid consumption history
*/
static async GridConsumptionHistory(): Promise<number[]> {
return (
await APIClient.exec({
method: "GET",
uri: "/energy/curr_consumption/history",
})
).data;
}
/** /**
* Get current cached consumption * Get current cached consumption
*/ */
@@ -22,4 +34,28 @@ export class EnergyApi {
}); });
return data.data.consumption; return data.data.consumption;
} }
/**
* Get relays consumption
*/
static async RelaysConsumption(): Promise<number> {
return (
await APIClient.exec({
method: "GET",
uri: "/energy/relays_consumption",
})
).data.consumption;
}
/**
* Get relays consumption history
*/
static async RelaysConsumptionHistory(): Promise<number[]> {
return (
await APIClient.exec({
method: "GET",
uri: "/energy/relays_consumption/history",
})
).data;
}
} }

View File

@@ -0,0 +1,29 @@
import { Dayjs } from "dayjs";
import { APIClient } from "./ApiClient";
export type LogSeverity = "Debug" | "Info" | "Warn" | "Error";
export interface LogEntry {
device_id: string;
time: number;
severity: LogSeverity;
message: string;
}
export class LogsAPI {
/**
* Request the logs from the server
*
* @param date The date that contains the requested date
*/
static async GetLogs(date: Dayjs): Promise<LogEntry[]> {
const day = Math.floor(date.unix() / (3600 * 24));
const res = await APIClient.exec({
uri: `/logging/logs?day=${day}`,
method: "GET",
});
return res.data;
}
}

View File

@@ -0,0 +1,87 @@
import { APIClient } from "./ApiClient";
export interface OTAUpdate {
platform: string;
version: string;
file_size: number;
}
export class OTAAPI {
/**
* Get the list of supported OTA platforms
*/
static async SupportedPlatforms(): Promise<Array<string>> {
return (
await APIClient.exec({
method: "GET",
uri: "/ota/supported_platforms",
})
).data;
}
/**
* Upload new OTA firwmare
*/
static async UploadFirmware(
platform: string,
version: string,
firmware: File
): Promise<void> {
const fd = new FormData();
fd.append("firmware", firmware);
await APIClient.exec({
method: "POST",
uri: `/ota/${platform}/${version}`,
formData: fd,
});
}
/**
* Get the link to download an OTA update
*/
static DownloadOTAUpdateURL(update: OTAUpdate): string {
return APIClient.backendURL() + `/ota/${update.platform}/${update.version}`;
}
/**
* Delete an update
*/
static async DeleteUpdate(update: OTAUpdate): Promise<void> {
await APIClient.exec({
method: "DELETE",
uri: `/ota/${update.platform}/${update.version}`,
});
}
/**
* Get the list of OTA updates
*/
static async ListOTAUpdates(): Promise<OTAUpdate[]> {
return (
await APIClient.exec({
method: "GET",
uri: "/ota",
})
).data;
}
/**
* Set desired version for one or mor devices
*/
static async SetDesiredVersion(
update: OTAUpdate,
all_devices: boolean,
devices?: string[]
): Promise<void> {
await APIClient.exec({
method: "POST",
uri: "/ota/set_desired_version",
jsonData: {
version: update.version,
platform: update.platform,
devices: all_devices ? undefined : devices!,
},
});
}
}

View File

@@ -1,6 +1,23 @@
import { APIClient } from "./ApiClient"; import { APIClient } from "./ApiClient";
import { Device, DeviceRelay } from "./DeviceApi"; import { Device, DeviceRelay } from "./DeviceApi";
export type RelayForcedState =
| { type: "None" }
| { type: "Off" | "On"; until: number };
export type SetRelayForcedState =
| { type: "None" }
| { type: "Off" | "On"; for_secs: number };
export interface RelayStatus {
id: string;
on: boolean;
for: number;
forced_state: RelayForcedState;
}
export type RelaysStatus = Map<string, RelayStatus>;
export class RelayApi { export class RelayApi {
/** /**
* Get the full list of relays * Get the full list of relays
@@ -40,6 +57,20 @@ export class RelayApi {
}); });
} }
/**
* Set relay forced state
*/
static async SetForcedState(
relay: DeviceRelay,
forced: SetRelayForcedState
): Promise<void> {
await APIClient.exec({
method: "PUT",
uri: `/relay/${relay.id}/forced_state`,
jsonData: forced,
});
}
/** /**
* Delete a relay configuration * Delete a relay configuration
*/ */
@@ -49,4 +80,34 @@ export class RelayApi {
uri: `/relay/${relay.id}`, uri: `/relay/${relay.id}`,
}); });
} }
/**
* Get the status of all relays
*/
static async GetRelaysStatus(): Promise<RelaysStatus> {
const data: any[] = (
await APIClient.exec({
method: "GET",
uri: `/relays/status`,
})
).data;
const map = new Map();
for (let r of data) {
map.set(r.id, r);
}
return map;
}
/**
* Get the status of a single relay
*/
static async SingleStatus(relay: DeviceRelay): Promise<RelayStatus> {
return (
await APIClient.exec({
method: "GET",
uri: `/relay/${relay.id}/status`,
})
).data;
}
} }

View File

@@ -3,6 +3,11 @@ import { APIClient } from "./ApiClient";
export interface ServerConfig { export interface ServerConfig {
auth_disabled: boolean; auth_disabled: boolean;
constraints: ServerConstraint; constraints: ServerConstraint;
unsecure_origin: string;
backend_version: string;
dashboard_custom_current_consumption_title?: string;
dashboard_custom_relays_consumption_title?: string;
dashboard_custom_cached_consumption_title?: string;
} }
export interface ServerConstraint { export interface ServerConstraint {

View File

@@ -0,0 +1,148 @@
import {
Button,
Checkbox,
Dialog,
DialogActions,
DialogContent,
DialogContentText,
DialogTitle,
FormControl,
FormControlLabel,
FormGroup,
FormLabel,
Radio,
RadioGroup,
Typography,
} from "@mui/material";
import React from "react";
import { Device, DeviceApi } from "../api/DeviceApi";
import { OTAAPI, OTAUpdate } from "../api/OTAApi";
import { useAlert } from "../hooks/context_providers/AlertDialogProvider";
import { useConfirm } from "../hooks/context_providers/ConfirmDialogProvider";
import { useLoadingMessage } from "../hooks/context_providers/LoadingMessageProvider";
import { useSnackbar } from "../hooks/context_providers/SnackbarProvider";
import { AsyncWidget } from "../widgets/AsyncWidget";
export function DeployOTAUpdateDialogProvider(p: {
update: OTAUpdate;
onClose: () => void;
}): React.ReactElement {
const loadingMessage = useLoadingMessage();
const alert = useAlert();
const confirm = useConfirm();
const snackbar = useSnackbar();
const [devicesList, setDevicesList] = React.useState<Device[] | undefined>();
const loadDevicesList = async () => {
let list = await DeviceApi.ValidatedList();
list = list.filter((e) => e.info.reference == p.update.platform);
setDevicesList(list);
};
const [allDevices, setAllDevices] = React.useState(false);
const [selectedDevices, setSelectedDevices] = React.useState<string[]>([]);
const startDeployment = async () => {
if (
allDevices &&
!(await confirm(
"Do you really want to deploy the update to all devices?"
))
)
return;
try {
loadingMessage.show("Applying OTA update...");
await OTAAPI.SetDesiredVersion(p.update, allDevices, selectedDevices);
snackbar("The update was successfully applied!");
p.onClose();
} catch (e) {
console.error("Failed to deploy the udpate!", e);
alert(`Failed to deploy the udpate! ${e}`);
} finally {
loadingMessage.hide();
}
};
return (
<Dialog open={true} onClose={p.onClose}>
<DialogTitle>
Deploy update <i>{p.update.version}</i> for platform{" "}
<i>{p.update.platform}</i>
</DialogTitle>
<AsyncWidget
loadKey={1}
load={loadDevicesList}
errMsg="Failed to load the list of devices!"
build={() => (
<DialogContent>
<DialogContentText>
You can choose to deploy update to all device or to target only a
part of devices:
</DialogContentText>
<FormControl>
<FormLabel>Deployment target</FormLabel>
<RadioGroup
name="radio-buttons-group"
value={allDevices}
onChange={(v) => setAllDevices(v.target.value == "true")}
>
<FormControlLabel
value={true}
control={<Radio />}
label="Deploy the update to all the devices of the platform"
/>
<FormControlLabel
value={false}
control={<Radio />}
label="Deploy the update to a limited range of devices"
/>
</RadioGroup>
</FormControl>
{!allDevices && (
<Typography>
There are no devices to which the update can be deployed.
</Typography>
)}
{!allDevices && (
<FormGroup>
{devicesList?.map((d) => (
<FormControlLabel
control={
<Checkbox
checked={selectedDevices.includes(d.id)}
onChange={(_e, v) => {
if (v) {
selectedDevices.push(d.id);
setSelectedDevices([...selectedDevices]);
} else
setSelectedDevices(
selectedDevices.filter((e) => e != d.id)
);
}}
/>
}
label={d.name}
/>
))}
</FormGroup>
)}
</DialogContent>
)}
/>
<DialogActions>
<Button onClick={p.onClose}>Cancel</Button>
<Button
onClick={startDeployment}
autoFocus
disabled={!allDevices && selectedDevices.length == 0}
>
Start deployment
</Button>
</DialogActions>
</Dialog>
);
}

View File

@@ -6,7 +6,7 @@ import {
DialogTitle, DialogTitle,
Typography, Typography,
} from "@mui/material"; } from "@mui/material";
import Grid from "@mui/material/Grid2"; import Grid from "@mui/material/Grid";
import { TimePicker } from "@mui/x-date-pickers"; import { TimePicker } from "@mui/x-date-pickers";
import React from "react"; import React from "react";
import { Device, DeviceRelay } from "../api/DeviceApi"; import { Device, DeviceRelay } from "../api/DeviceApi";

View File

@@ -0,0 +1,53 @@
import {
Button,
Dialog,
DialogActions,
DialogContent,
DialogContentText,
DialogTitle,
TextField,
} from "@mui/material";
import { DeviceRelay } from "../api/DeviceApi";
import React from "react";
export function SelectForcedStateDurationDialog(p: {
relay: DeviceRelay;
forcedState: string;
onCancel: () => void;
onSubmit: (duration: number) => void;
}): React.ReactElement {
const [duration, setDuration] = React.useState(60);
return (
<Dialog open onClose={p.onCancel}>
<DialogTitle>Set forced relay state</DialogTitle>
<DialogContent>
<DialogContentText>
Please specify the number of minutes the relay <i>{p.relay.name}</i>{" "}
will remain in forced state <i>{p.forcedState}</i>:
</DialogContentText>
<TextField
label="Duration (min)"
variant="standard"
value={Math.floor(duration / 60)}
onChange={(e) => {
const val = Number.parseInt(e.target.value);
setDuration((Number.isNaN(val) ? 1 : val) * 60);
}}
fullWidth
style={{ marginTop: "5px" }}
/>
<p>Equivalent in seconds: {duration} secs</p>
<p>Equivalent in hours: {duration / 3600} hours</p>
</DialogContent>
<DialogActions>
<Button onClick={p.onCancel}>Cancel</Button>
<Button onClick={() => p.onSubmit(duration)} autoFocus>
Start timer
</Button>
</DialogActions>
</Dialog>
);
}

View File

@@ -0,0 +1,132 @@
import CloudUploadIcon from "@mui/icons-material/CloudUpload";
import {
Button,
Dialog,
DialogActions,
DialogContent,
DialogContentText,
DialogTitle,
FormControl,
InputLabel,
MenuItem,
Select,
styled,
} from "@mui/material";
import React from "react";
import { OTAAPI } from "../api/OTAApi";
import { useAlert } from "../hooks/context_providers/AlertDialogProvider";
import { useLoadingMessage } from "../hooks/context_providers/LoadingMessageProvider";
import { useSnackbar } from "../hooks/context_providers/SnackbarProvider";
import { checkVersion } from "../utils/StringsUtils";
import { TextInput } from "../widgets/forms/TextInput";
const VisuallyHiddenInput = styled("input")({
clip: "rect(0 0 0 0)",
clipPath: "inset(50%)",
height: 1,
overflow: "hidden",
position: "absolute",
bottom: 0,
left: 0,
whiteSpace: "nowrap",
width: 1,
});
export function UploadUpdateDialog(p: {
platforms: string[];
onClose: () => void;
onCreated: () => void;
}): React.ReactElement {
const alert = useAlert();
const snackbar = useSnackbar();
const loadingMessage = useLoadingMessage();
const [platform, setPlatform] = React.useState<string | undefined>();
const [version, setVersion] = React.useState<string | undefined>();
const [file, setFile] = React.useState<File | undefined>();
const canSubmit = platform && version && checkVersion(version) && file;
const upload = async () => {
try {
loadingMessage.show("Uploading firmware...");
await OTAAPI.UploadFirmware(platform!, version!, file!);
snackbar("Successfully uploaded new firmware!");
p.onCreated();
} catch (e) {
console.error(e);
alert(`Failed to upload firmware: ${e}`);
} finally {
loadingMessage.hide();
}
};
return (
<Dialog open={true} onClose={p.onClose}>
<DialogTitle>Submit a new update</DialogTitle>
<DialogContent>
<DialogContentText>
You can upload a new firmware using this form.
</DialogContentText>
<br />
<FormControl fullWidth>
<InputLabel>Platform</InputLabel>
<Select
label="Platform"
value={platform}
onChange={(e) => setPlatform(e.target.value)}
variant="standard"
>
{p.platforms.map((p) => (
<MenuItem key={p} value={p}>
{p}
</MenuItem>
))}
</Select>
</FormControl>
<br />
<br />
<TextInput
editable
label="Version"
helperText="The version shall follow semantics requirements"
value={version}
onValueChange={setVersion}
checkValue={checkVersion}
/>
<br />
<Button
fullWidth
component="label"
role={undefined}
variant={file ? "contained" : "outlined"}
tabIndex={-1}
startIcon={<CloudUploadIcon />}
>
Upload file
<VisuallyHiddenInput
type="file"
onChange={(event) =>
setFile(
(event.target.files?.length ?? 0) > 0
? event.target.files![0]
: undefined
)
}
multiple
/>
</Button>
</DialogContent>
<DialogActions>
<Button onClick={p.onClose}>Cancel</Button>
<Button type="submit" disabled={!canSubmit} onClick={upload}>
Upload
</Button>
</DialogActions>
</Dialog>
);
}

View File

@@ -3,7 +3,7 @@ import { TableCell, TableRow } from "@mui/material";
export function DeviceInfoProperty(p: { export function DeviceInfoProperty(p: {
icon?: React.ReactElement; icon?: React.ReactElement;
label: string; label: string;
value: string; value: string | React.ReactElement;
color?: string; color?: string;
}): React.ReactElement { }): React.ReactElement {
return ( return (

View File

@@ -10,13 +10,16 @@ import {
} from "@mui/material"; } from "@mui/material";
import React from "react"; import React from "react";
import { Device, DeviceRelay } from "../../api/DeviceApi"; import { Device, DeviceRelay } from "../../api/DeviceApi";
import { RelayApi, RelayStatus } from "../../api/RelayApi";
import { EditDeviceRelaysDialog } from "../../dialogs/EditDeviceRelaysDialog"; import { EditDeviceRelaysDialog } from "../../dialogs/EditDeviceRelaysDialog";
import { DeviceRouteCard } from "./DeviceRouteCard"; import { useAlert } from "../../hooks/context_providers/AlertDialogProvider";
import { useConfirm } from "../../hooks/context_providers/ConfirmDialogProvider"; import { useConfirm } from "../../hooks/context_providers/ConfirmDialogProvider";
import { useLoadingMessage } from "../../hooks/context_providers/LoadingMessageProvider"; import { useLoadingMessage } from "../../hooks/context_providers/LoadingMessageProvider";
import { RelayApi } from "../../api/RelayApi";
import { useSnackbar } from "../../hooks/context_providers/SnackbarProvider"; import { useSnackbar } from "../../hooks/context_providers/SnackbarProvider";
import { useAlert } from "../../hooks/context_providers/AlertDialogProvider"; import { AsyncWidget } from "../../widgets/AsyncWidget";
import { BoolText } from "../../widgets/BoolText";
import { TimeWidget } from "../../widgets/TimeWidget";
import { DeviceRouteCard } from "./DeviceRouteCard";
export function DeviceRelays(p: { export function DeviceRelays(p: {
device: Device; device: Device;
@@ -115,10 +118,38 @@ export function DeviceRelays(p: {
</> </>
} }
> >
<ListItemText primary={r.name} secondary={"TODO: status"} /> <ListItemText
primary={r.name}
secondary={<RelayEntryStatus relay={r} />}
/>
</ListItem> </ListItem>
))} ))}
</DeviceRouteCard> </DeviceRouteCard>
</> </>
); );
} }
function RelayEntryStatus(
p: Readonly<{ relay: DeviceRelay }>
): React.ReactElement {
const [state, setState] = React.useState<RelayStatus | undefined>();
const load = async () => {
setState(await RelayApi.SingleStatus(p.relay));
};
return (
<AsyncWidget
loadKey={p.relay.id}
load={load}
errMsg="Failed to load relay status!"
build={() => (
<>
<BoolText val={state!.on} positive="ON" negative="OFF" />{" "}
{state?.forced_state.type !== "None" && <b>Forced</b>} for{" "}
<TimeWidget diff time={state!.for} />
</>
)}
/>
);
}

View File

@@ -1,7 +1,7 @@
import DeleteIcon from "@mui/icons-material/Delete"; import DeleteIcon from "@mui/icons-material/Delete";
import RefreshIcon from "@mui/icons-material/Refresh"; import RefreshIcon from "@mui/icons-material/Refresh";
import { IconButton, Tooltip } from "@mui/material"; import { IconButton, Tooltip } from "@mui/material";
import Grid from "@mui/material/Grid2"; import Grid from "@mui/material/Grid";
import React from "react"; import React from "react";
import { useNavigate, useParams } from "react-router-dom"; import { useNavigate, useParams } from "react-router-dom";
import { Device, DeviceApi } from "../../api/DeviceApi"; import { Device, DeviceApi } from "../../api/DeviceApi";

View File

@@ -1,10 +1,11 @@
import { Table, TableBody } from "@mui/material";
import React from "react"; import React from "react";
import { Device, DeviceApi, DeviceState } from "../../api/DeviceApi"; import { Device, DeviceApi, DeviceState } from "../../api/DeviceApi";
import { AsyncWidget } from "../../widgets/AsyncWidget"; import { AsyncWidget } from "../../widgets/AsyncWidget";
import { DeviceRouteCard } from "./DeviceRouteCard"; import { BoolText } from "../../widgets/BoolText";
import { Table, TableBody } from "@mui/material";
import { DeviceInfoProperty } from "./DeviceInfoProperty";
import { timeDiff } from "../../widgets/TimeWidget"; import { timeDiff } from "../../widgets/TimeWidget";
import { DeviceInfoProperty } from "./DeviceInfoProperty";
import { DeviceRouteCard } from "./DeviceRouteCard";
export function DeviceStateBlock(p: { device: Device }): React.ReactElement { export function DeviceStateBlock(p: { device: Device }): React.ReactElement {
const [state, setState] = React.useState<DeviceState>(); const [state, setState] = React.useState<DeviceState>();
@@ -32,7 +33,13 @@ function DeviceStateInner(p: { state: DeviceState }): React.ReactElement {
<TableBody> <TableBody>
<DeviceInfoProperty <DeviceInfoProperty
label="Status" label="Status"
value={p.state.online ? "Online" : "Offline"} value={
<BoolText
val={p.state.online}
positive="ONLINE"
negative="Offline"
/>
}
/> />
<DeviceInfoProperty <DeviceInfoProperty
label="Last ping" label="Last ping"

View File

@@ -3,6 +3,7 @@ import { IconButton, Table, TableBody, Tooltip } from "@mui/material";
import React from "react"; import React from "react";
import { Device } from "../../api/DeviceApi"; import { Device } from "../../api/DeviceApi";
import { EditDeviceMetadataDialog } from "../../dialogs/EditDeviceMetadataDialog"; import { EditDeviceMetadataDialog } from "../../dialogs/EditDeviceMetadataDialog";
import { BoolText } from "../../widgets/BoolText";
import { formatDate } from "../../widgets/TimeWidget"; import { formatDate } from "../../widgets/TimeWidget";
import { DeviceInfoProperty } from "./DeviceInfoProperty"; import { DeviceInfoProperty } from "./DeviceInfoProperty";
import { DeviceRouteCard } from "./DeviceRouteCard"; import { DeviceRouteCard } from "./DeviceRouteCard";
@@ -40,6 +41,10 @@ export function GeneralDeviceInfo(p: {
value={p.device.info.reference} value={p.device.info.reference}
/> />
<DeviceInfoProperty label="Version" value={p.device.info.version} /> <DeviceInfoProperty label="Version" value={p.device.info.version} />
<DeviceInfoProperty
label="Desired version"
value={p.device.desired_version ?? "None"}
/>
<DeviceInfoProperty label="Name" value={p.device.name} /> <DeviceInfoProperty label="Name" value={p.device.name} />
<DeviceInfoProperty <DeviceInfoProperty
label="Description" label="Description"
@@ -55,8 +60,9 @@ export function GeneralDeviceInfo(p: {
/> />
<DeviceInfoProperty <DeviceInfoProperty
label="Enabled" label="Enabled"
value={p.device.enabled ? "YES" : "NO"} value={
color={p.device.enabled ? "green" : "red"} <BoolText val={p.device.enabled} positive="YES" negative="NO" />
}
/> />
<DeviceInfoProperty <DeviceInfoProperty
label="Maximum number of relays" label="Maximum number of relays"

View File

@@ -15,10 +15,11 @@ import React from "react";
import { Link, useNavigate } from "react-router-dom"; import { Link, useNavigate } from "react-router-dom";
import { Device, DeviceApi, DevicesState, DeviceURL } from "../api/DeviceApi"; import { Device, DeviceApi, DevicesState, DeviceURL } from "../api/DeviceApi";
import { AsyncWidget } from "../widgets/AsyncWidget"; import { AsyncWidget } from "../widgets/AsyncWidget";
import { BoolText } from "../widgets/BoolText";
import { SolarEnergyRouteContainer } from "../widgets/SolarEnergyRouteContainer"; import { SolarEnergyRouteContainer } from "../widgets/SolarEnergyRouteContainer";
import { TimeWidget } from "../widgets/TimeWidget"; import { TimeWidget } from "../widgets/TimeWidget";
export function DevicesRoute(): React.ReactElement { export function DevicesRoute(p: { homeWidget?: boolean }): React.ReactElement {
const loadKey = React.useRef(1); const loadKey = React.useRef(1);
const [list, setList] = React.useState<Device[] | undefined>(); const [list, setList] = React.useState<Device[] | undefined>();
@@ -37,6 +38,7 @@ export function DevicesRoute(): React.ReactElement {
return ( return (
<SolarEnergyRouteContainer <SolarEnergyRouteContainer
homeWidget={p.homeWidget}
label="Devices" label="Devices"
actions={ actions={
<Tooltip title="Refresh table"> <Tooltip title="Refresh table">
@@ -79,13 +81,13 @@ function ValidatedDevicesList(p: {
<Table sx={{ minWidth: 650 }} aria-label="simple table"> <Table sx={{ minWidth: 650 }} aria-label="simple table">
<TableHead> <TableHead>
<TableRow> <TableRow>
<TableCell>#</TableCell> <TableCell>Name</TableCell>
<TableCell>Model</TableCell> <TableCell align="center">Model</TableCell>
<TableCell>Version</TableCell> <TableCell align="center">Version</TableCell>
<TableCell>Max number of relays</TableCell> <TableCell align="center">Max relays</TableCell>
<TableCell>Created</TableCell> <TableCell align="center">Created</TableCell>
<TableCell>Updated</TableCell> <TableCell align="center">Updated</TableCell>
<TableCell>Status</TableCell> <TableCell align="center">Status</TableCell>
<TableCell></TableCell> <TableCell></TableCell>
</TableRow> </TableRow>
</TableHead> </TableHead>
@@ -97,23 +99,23 @@ function ValidatedDevicesList(p: {
onDoubleClick={() => navigate(DeviceURL(dev))} onDoubleClick={() => navigate(DeviceURL(dev))}
> >
<TableCell component="th" scope="row"> <TableCell component="th" scope="row">
{dev.id} {dev.name}
</TableCell> </TableCell>
<TableCell>{dev.info.reference}</TableCell> <TableCell align="center">{dev.info.reference}</TableCell>
<TableCell>{dev.info.version}</TableCell> <TableCell align="center">{dev.info.version}</TableCell>
<TableCell>{dev.info.max_relays}</TableCell> <TableCell align="center">{dev.info.max_relays}</TableCell>
<TableCell> <TableCell align="center">
<TimeWidget time={dev.time_create} /> <TimeWidget time={dev.time_create} />
</TableCell> </TableCell>
<TableCell> <TableCell align="center">
<TimeWidget time={dev.time_update} /> <TimeWidget time={dev.time_update} />
</TableCell> </TableCell>
<TableCell align="center"> <TableCell align="center">
{p.states.get(dev.id)!.online ? ( <BoolText
<strong>Online</strong> val={p.states.get(dev.id)!.online}
) : ( positive="Online"
<em>Offline</em> negative="Offline"
)} />
<br /> <br />
<TimeWidget diff time={p.states.get(dev.id)!.last_ping} /> <TimeWidget diff time={p.states.get(dev.id)!.last_ping} />
</TableCell> </TableCell>

View File

@@ -1,7 +1,10 @@
import { Typography } from "@mui/material"; import { Typography } from "@mui/material";
import { CurrConsumptionWidget } from "./HomeRoute/CurrConsumptionWidget"; import { CurrConsumptionWidget } from "./HomeRoute/CurrConsumptionWidget";
import Grid from "@mui/material/Grid2"; import Grid from "@mui/material/Grid";
import { CachedConsumptionWidget } from "./HomeRoute/CachedConsumptionWidget"; import { CachedConsumptionWidget } from "./HomeRoute/CachedConsumptionWidget";
import { RelayConsumptionWidget } from "./HomeRoute/RelayConsumptionWidget";
import { RelaysListRoute } from "./RelaysListRoute";
import { DevicesRoute } from "./DevicesRoute";
export function HomeRoute(): React.ReactElement { export function HomeRoute(): React.ReactElement {
return ( return (
@@ -18,9 +21,20 @@ export function HomeRoute(): React.ReactElement {
<Grid size={{ xs: 12, sm: 6, lg: 3 }}> <Grid size={{ xs: 12, sm: 6, lg: 3 }}>
<CurrConsumptionWidget /> <CurrConsumptionWidget />
</Grid> </Grid>
<Grid size={{ xs: 12, sm: 6, lg: 3 }}>
<RelayConsumptionWidget />
</Grid>
<Grid size={{ xs: 12, sm: 6, lg: 3 }}> <Grid size={{ xs: 12, sm: 6, lg: 3 }}>
<CachedConsumptionWidget /> <CachedConsumptionWidget />
</Grid> </Grid>
<Grid size={{ xs: 12, sm: 12, lg: 9 }}>
<DevicesRoute homeWidget />
</Grid>
<Grid size={{ xs: 12, sm: 12, lg: 9 }}>
<RelaysListRoute homeWidget />
</Grid>
</Grid> </Grid>
</div> </div>
); );

View File

@@ -2,6 +2,7 @@ import React from "react";
import { EnergyApi } from "../../api/EnergyApi"; import { EnergyApi } from "../../api/EnergyApi";
import { useSnackbar } from "../../hooks/context_providers/SnackbarProvider"; import { useSnackbar } from "../../hooks/context_providers/SnackbarProvider";
import StatCard from "../../widgets/StatCard"; import StatCard from "../../widgets/StatCard";
import { ServerApi } from "../../api/ServerApi";
export function CachedConsumptionWidget(): React.ReactElement { export function CachedConsumptionWidget(): React.ReactElement {
const snackbar = useSnackbar(); const snackbar = useSnackbar();
@@ -27,10 +28,10 @@ export function CachedConsumptionWidget(): React.ReactElement {
return ( return (
<StatCard <StatCard
title="Cached consumption" title={
data={[]} ServerApi.Config.dashboard_custom_cached_consumption_title ??
interval="Current data" "Cached consumption"
trend="neutral" }
value={val?.toString() ?? "Loading"} value={val?.toString() ?? "Loading"}
/> />
); );

View File

@@ -2,16 +2,20 @@ import React from "react";
import { EnergyApi } from "../../api/EnergyApi"; import { EnergyApi } from "../../api/EnergyApi";
import { useSnackbar } from "../../hooks/context_providers/SnackbarProvider"; import { useSnackbar } from "../../hooks/context_providers/SnackbarProvider";
import StatCard from "../../widgets/StatCard"; import StatCard from "../../widgets/StatCard";
import { ServerApi } from "../../api/ServerApi";
export function CurrConsumptionWidget(): React.ReactElement { export function CurrConsumptionWidget(): React.ReactElement {
const snackbar = useSnackbar(); const snackbar = useSnackbar();
const [val, setVal] = React.useState<undefined | number>(); const [val, setVal] = React.useState<undefined | number>();
const [history, setHistory] = React.useState<number[] | undefined>();
const refresh = async () => { const refresh = async () => {
try { try {
const s = await EnergyApi.CurrConsumption(); const s = await EnergyApi.GridConsumption();
const history = await EnergyApi.GridConsumptionHistory();
setVal(s); setVal(s);
setHistory(history);
} catch (e) { } catch (e) {
console.error(e); console.error(e);
snackbar("Failed to refresh current consumption!"); snackbar("Failed to refresh current consumption!");
@@ -19,7 +23,6 @@ export function CurrConsumptionWidget(): React.ReactElement {
}; };
React.useEffect(() => { React.useEffect(() => {
refresh();
const i = setInterval(() => refresh(), 3000); const i = setInterval(() => refresh(), 3000);
return () => clearInterval(i); return () => clearInterval(i);
@@ -27,10 +30,12 @@ export function CurrConsumptionWidget(): React.ReactElement {
return ( return (
<StatCard <StatCard
title="Current consumption" title={
data={[]} ServerApi.Config.dashboard_custom_current_consumption_title ??
interval="Current data" "Current consumption"
trend="neutral" }
data={history ?? []}
interval="Last day"
value={val?.toString() ?? "Loading"} value={val?.toString() ?? "Loading"}
/> />
); );

View File

@@ -0,0 +1,42 @@
import React from "react";
import { EnergyApi } from "../../api/EnergyApi";
import { useSnackbar } from "../../hooks/context_providers/SnackbarProvider";
import StatCard from "../../widgets/StatCard";
import { ServerApi } from "../../api/ServerApi";
export function RelayConsumptionWidget(): React.ReactElement {
const snackbar = useSnackbar();
const [val, setVal] = React.useState<undefined | number>();
const [history, setHistory] = React.useState<number[] | undefined>();
const refresh = async () => {
try {
const s = await EnergyApi.RelaysConsumption();
const history = await EnergyApi.RelaysConsumptionHistory();
setVal(s);
setHistory(history);
} catch (e) {
console.error(e);
snackbar("Failed to refresh current relays consumption!");
}
};
React.useEffect(() => {
const i = setInterval(() => refresh(), 3000);
return () => clearInterval(i);
});
return (
<StatCard
title={
ServerApi.Config.dashboard_custom_relays_consumption_title ??
"Relays consumption"
}
data={history ?? []}
interval="Last day"
value={val?.toString() ?? "Loading"}
/>
);
}

View File

@@ -11,7 +11,7 @@ import Typography from "@mui/material/Typography";
import * as React from "react"; import * as React from "react";
import { useLoadingMessage } from "../hooks/context_providers/LoadingMessageProvider"; import { useLoadingMessage } from "../hooks/context_providers/LoadingMessageProvider";
import { AuthApi } from "../api/AuthApi"; import { AuthApi } from "../api/AuthApi";
import Grid from "@mui/material/Grid2"; import Grid from "@mui/material/Grid";
function Copyright(props: any) { function Copyright(props: any) {
return ( return (
@@ -62,7 +62,7 @@ export function LoginRoute() {
<Grid <Grid
size={{ sm: 4, md: 7, xs: false }} size={{ sm: 4, md: 7, xs: false }}
sx={{ sx={{
backgroundImage: 'url("/sun.jpg")', backgroundImage: 'url("/assets/sun.jpg")',
backgroundColor: (t) => backgroundColor: (t) =>
t.palette.mode === "light" t.palette.mode === "light"
? t.palette.grey[50] ? t.palette.grey[50]

View File

@@ -0,0 +1,124 @@
import NavigateBeforeIcon from "@mui/icons-material/NavigateBefore";
import NavigateNextIcon from "@mui/icons-material/NavigateNext";
import RefreshIcon from "@mui/icons-material/Refresh";
import {
IconButton,
Paper,
Table,
TableBody,
TableCell,
TableContainer,
TableHead,
TableRow,
Tooltip,
Typography,
} from "@mui/material";
import { DatePicker } from "@mui/x-date-pickers";
import dayjs from "dayjs";
import React from "react";
import { LogEntry, LogsAPI } from "../api/LogsAPI";
import { AsyncWidget } from "../widgets/AsyncWidget";
import { SolarEnergyRouteContainer } from "../widgets/SolarEnergyRouteContainer";
export function LogsRoute(): React.ReactElement {
const loadKey = React.useRef(1);
const [currDate, setCurrDate] = React.useState(dayjs());
const [logs, setLogs] = React.useState<LogEntry[] | undefined>();
const load = async () => {
const logs = await LogsAPI.GetLogs(currDate);
logs.reverse();
setLogs(logs);
};
const reload = () => {
setLogs(undefined);
loadKey.current += 1;
};
return (
<SolarEnergyRouteContainer
label="Logs"
actions={
<Tooltip title="Refresh logs">
<IconButton onClick={reload}>
<RefreshIcon />
</IconButton>
</Tooltip>
}
>
<div
style={{
width: "100%",
display: "flex",
alignItems: "center",
justifyContent: "center",
marginBottom: "10px",
}}
>
<Tooltip title="Previous day">
<IconButton onClick={() => setCurrDate(currDate.add(-1, "day"))}>
<NavigateBeforeIcon />
</IconButton>
</Tooltip>
<DatePicker
label="Shown day"
value={currDate}
onChange={(d) => setCurrDate(d === null ? currDate : d)}
/>
<Tooltip title="Next day">
<IconButton onClick={() => setCurrDate(currDate.add(1, "day"))}>
<NavigateNextIcon />
</IconButton>
</Tooltip>
</div>
<AsyncWidget
ready={!!logs}
loadKey={loadKey.current + currDate.toString()}
errMsg="Failed to load the logs!"
load={load}
build={() => <LogsView logs={logs!} />}
/>
</SolarEnergyRouteContainer>
);
}
function LogsView(p: { logs: LogEntry[] }): React.ReactElement {
if (p.logs.length == 0) {
return (
<Typography style={{ textAlign: "center" }}>
There was no log recorded on this day.
</Typography>
);
}
return (
<TableContainer component={Paper}>
<Table sx={{ minWidth: 650 }} size="small" aria-label="a dense table">
<TableHead>
<TableRow>
<TableCell>Device ID</TableCell>
<TableCell>Time</TableCell>
<TableCell>Severity</TableCell>
<TableCell>Message</TableCell>
</TableRow>
</TableHead>
<TableBody>
{p.logs.map((row, id) => (
<TableRow key={id} hover>
<TableCell component="th" scope="row">
{row.device_id ?? "Backend"}
</TableCell>
<TableCell>
{new Date(row.time * 1000).toLocaleTimeString()}
</TableCell>
<TableCell>{row.severity}</TableCell>
<TableCell>{row.message}</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</TableContainer>
);
}

View File

@@ -0,0 +1,31 @@
import { Button } from "@mui/material";
import { useConfirm } from "../hooks/context_providers/ConfirmDialogProvider";
import { SolarEnergyRouteContainer } from "../widgets/SolarEnergyRouteContainer";
import { APIClient } from "../api/ApiClient";
export function ManagementRoute(): React.ReactElement {
const confirm = useConfirm();
const downloadBackup = async () => {
try {
if (
!(await confirm(
`Do you really want to download a copy of the storage? It will contain sensitive information!`
))
)
return;
location.href = APIClient.backendURL() + "/management/download_storage";
} catch (e) {
console.error(`Failed to donwload a backup of the storage! Error: ${e}`);
}
};
return (
<SolarEnergyRouteContainer label="Management">
<Button variant="outlined" onClick={downloadBackup}>
Download a backup of storage
</Button>
</SolarEnergyRouteContainer>
);
}

View File

@@ -0,0 +1,203 @@
import { mdiFolderUploadOutline } from "@mdi/js";
import Icon from "@mdi/react";
import DeleteIcon from "@mui/icons-material/Delete";
import DownloadIcon from "@mui/icons-material/Download";
import FileUploadIcon from "@mui/icons-material/FileUpload";
import RefreshIcon from "@mui/icons-material/Refresh";
import {
IconButton,
Paper,
Table,
TableBody,
TableCell,
TableContainer,
TableHead,
TableRow,
Tooltip,
Typography,
} from "@mui/material";
import { filesize } from "filesize";
import React from "react";
import { OTAAPI, OTAUpdate } from "../api/OTAApi";
import { DeployOTAUpdateDialogProvider } from "../dialogs/DeployOTAUpdateDialogProvider";
import { UploadUpdateDialog } from "../dialogs/UploadUpdateDialog";
import { useAlert } from "../hooks/context_providers/AlertDialogProvider";
import { useConfirm } from "../hooks/context_providers/ConfirmDialogProvider";
import { useLoadingMessage } from "../hooks/context_providers/LoadingMessageProvider";
import { useSnackbar } from "../hooks/context_providers/SnackbarProvider";
import { AsyncWidget } from "../widgets/AsyncWidget";
import { RouterLink } from "../widgets/RouterLink";
import { SolarEnergyRouteContainer } from "../widgets/SolarEnergyRouteContainer";
export function OTARoute(): React.ReactElement {
const [list, setList] = React.useState<string[] | undefined>();
const load = async () => {
setList(await OTAAPI.SupportedPlatforms());
};
return (
<AsyncWidget
loadKey={1}
ready={!!list}
load={load}
errMsg="Failed to load OTA screen!"
build={() => <_OTARoute platforms={list!} />}
/>
);
}
function _OTARoute(p: { platforms: Array<string> }): React.ReactElement {
const key = React.useRef(1);
const [showUploadDialog, setShowUploadDialog] = React.useState(false);
const [list, setList] = React.useState<undefined | OTAUpdate[]>();
const load = async () => {
const list = await OTAAPI.ListOTAUpdates();
list.sort((a, b) =>
`${a.platform}#${a.version}`.localeCompare(`${b.platform}#${b.version}`)
);
list.reverse();
setList(list);
};
const reload = async () => {
key.current += 1;
setList(undefined);
};
return (
<SolarEnergyRouteContainer
label="OTA"
actions={
<span>
<Tooltip title="Refresh the list of updates">
<IconButton onClick={reload}>
<RefreshIcon />
</IconButton>
</Tooltip>
<Tooltip title="Upload a new update">
<IconButton onClick={() => setShowUploadDialog(true)}>
<FileUploadIcon />
</IconButton>
</Tooltip>
</span>
}
>
{showUploadDialog && (
<UploadUpdateDialog
platforms={p.platforms}
onClose={() => setShowUploadDialog(false)}
onCreated={() => {
setShowUploadDialog(false);
reload();
}}
/>
)}
<AsyncWidget
loadKey={key.current}
ready={!!list}
errMsg="Failed to load the list of OTA updates!"
load={load}
build={() => <_OTAList list={list!} onReload={reload} />}
/>
</SolarEnergyRouteContainer>
);
}
function _OTAList(p: {
list: OTAUpdate[];
onReload: () => void;
}): React.ReactElement {
const alert = useAlert();
const confirm = useConfirm();
const loadingMessage = useLoadingMessage();
const snackbar = useSnackbar();
const [deployUpdate, setDeployUpdate] = React.useState<
OTAUpdate | undefined
>();
const deleteUpdate = async (update: OTAUpdate) => {
if (
!(await confirm(
`Do you really want to delete the update for platform ${update.platform} version ${update.version}?`
))
)
return;
try {
loadingMessage.show("Deleting update...");
await OTAAPI.DeleteUpdate(update);
snackbar("The update was successfully deleted!");
p.onReload();
} catch (e) {
console.error("Failed to delete update!", e);
alert(`Failed to delete the update! ${e}`);
} finally {
loadingMessage.hide();
}
};
if (p.list.length === 0) {
return (
<Typography>
There is no OTA update uploaded on the platform yet.
</Typography>
);
}
return (
<>
{deployUpdate && (
<DeployOTAUpdateDialogProvider
update={deployUpdate!}
onClose={() => setDeployUpdate(undefined)}
/>
)}
<TableContainer component={Paper}>
<Table sx={{ minWidth: 650 }} aria-label="list of updates">
<TableHead>
<TableRow>
<TableCell align="center">Platform</TableCell>
<TableCell align="center">Version</TableCell>
<TableCell align="center">File size</TableCell>
<TableCell align="center"></TableCell>
</TableRow>
</TableHead>
<TableBody>
{p.list.map((row, num) => (
<TableRow hover key={num}>
<TableCell align="center">{row.platform}</TableCell>
<TableCell align="center">{row.version}</TableCell>
<TableCell align="center">{filesize(row.file_size)}</TableCell>
<TableCell align="center">
<Tooltip title="Deploy the update to devices">
<IconButton onClick={() => setDeployUpdate(row)}>
<Icon path={mdiFolderUploadOutline} size={1} />
</IconButton>
</Tooltip>
<Tooltip title="Download a copy of the firmware">
<RouterLink to={OTAAPI.DownloadOTAUpdateURL(row)}>
<IconButton>
<DownloadIcon />
</IconButton>
</RouterLink>
</Tooltip>
<Tooltip title="Delete firmware update">
<IconButton onClick={() => deleteUpdate(row)}>
<DeleteIcon />
</IconButton>
</Tooltip>
</TableCell>
</TableRow>
))}
</TableBody>
</Table>
</TableContainer>
</>
);
}

View File

@@ -1,3 +1,4 @@
import LinkIcon from "@mui/icons-material/Link";
import RefreshIcon from "@mui/icons-material/Refresh"; import RefreshIcon from "@mui/icons-material/Refresh";
import { import {
IconButton, IconButton,
@@ -9,20 +10,33 @@ import {
TableHead, TableHead,
TableRow, TableRow,
Tooltip, Tooltip,
Typography,
} from "@mui/material"; } from "@mui/material";
import React from "react"; import React from "react";
import { DeviceRelay } from "../api/DeviceApi"; import { useNavigate } from "react-router-dom";
import { RelayApi } from "../api/RelayApi"; import { Device, DeviceApi, DeviceRelay, DeviceURL } from "../api/DeviceApi";
import { RelayApi, RelaysStatus } from "../api/RelayApi";
import { ServerApi } from "../api/ServerApi";
import { AsyncWidget } from "../widgets/AsyncWidget"; import { AsyncWidget } from "../widgets/AsyncWidget";
import { BoolText } from "../widgets/BoolText";
import { CopyToClipboard } from "../widgets/CopyToClipboard";
import { RelayForcedState } from "../widgets/RelayForcedState";
import { SolarEnergyRouteContainer } from "../widgets/SolarEnergyRouteContainer"; import { SolarEnergyRouteContainer } from "../widgets/SolarEnergyRouteContainer";
import { TimeWidget } from "../widgets/TimeWidget";
export function RelaysListRoute(): React.ReactElement { export function RelaysListRoute(p: {
homeWidget?: boolean;
}): React.ReactElement {
const loadKey = React.useRef(1); const loadKey = React.useRef(1);
const [list, setList] = React.useState<DeviceRelay[] | undefined>(); const [list, setList] = React.useState<DeviceRelay[] | undefined>();
const [devices, setDevices] = React.useState<Device[] | undefined>();
const [status, setStatus] = React.useState<RelaysStatus | undefined>();
const load = async () => { const load = async () => {
setList(await RelayApi.GetList()); setList(await RelayApi.GetList());
setDevices(await DeviceApi.ValidatedList());
setStatus(await RelayApi.GetRelaysStatus());
list?.sort((a, b) => b.priority - a.priority); list?.sort((a, b) => b.priority - a.priority);
}; };
@@ -33,34 +47,57 @@ export function RelaysListRoute(): React.ReactElement {
}; };
return ( return (
<SolarEnergyRouteContainer <>
label="Relays list" <SolarEnergyRouteContainer
actions={ label="Relays list"
<Tooltip title="Refresh list"> homeWidget={p.homeWidget}
<IconButton onClick={reload}> actions={
<RefreshIcon /> <Tooltip title="Refresh list">
</IconButton> <IconButton onClick={reload}>
</Tooltip> <RefreshIcon />
} </IconButton>
> </Tooltip>
<AsyncWidget }
loadKey={loadKey.current} >
ready={!!list} <AsyncWidget
errMsg="Failed to load the list of relays!" loadKey={loadKey.current}
load={load} ready={!!list}
build={() => <RelaysList onReload={reload} list={list!} />} errMsg="Failed to load the list of relays!"
/> load={load}
</SolarEnergyRouteContainer> build={() => (
<RelaysList
onReload={reload}
list={list!}
devices={devices!}
status={status!}
/>
)}
/>
</SolarEnergyRouteContainer>
</>
); );
} }
function RelaysList(p: { function RelaysList(p: {
list: DeviceRelay[]; list: DeviceRelay[];
devices: Device[];
status: RelaysStatus;
onReload: () => void; onReload: () => void;
}): React.ReactElement { }): React.ReactElement {
const navigate = useNavigate();
const openDevicePage = (relay: DeviceRelay) => {
const dev = p.devices.find((d) => d.relays.find((r) => r.id === relay.id));
navigate(DeviceURL(dev!));
};
if (p.list.length === 0) {
return <Typography>There is no configured relay yet!</Typography>;
}
return ( return (
<TableContainer component={Paper}> <TableContainer component={Paper}>
<Table sx={{ minWidth: 650 }} aria-label="simple table"> <Table sx={{ minWidth: 650 }}>
<TableHead> <TableHead>
<TableRow> <TableRow>
<TableCell>Name</TableCell> <TableCell>Name</TableCell>
@@ -68,6 +105,8 @@ function RelaysList(p: {
<TableCell>Priority</TableCell> <TableCell>Priority</TableCell>
<TableCell>Consumption</TableCell> <TableCell>Consumption</TableCell>
<TableCell>Status</TableCell> <TableCell>Status</TableCell>
<TableCell>Forced state</TableCell>
<TableCell></TableCell>
</TableRow> </TableRow>
</TableHead> </TableHead>
<TableBody> <TableBody>
@@ -75,18 +114,44 @@ function RelaysList(p: {
<TableRow <TableRow
key={row.name} key={row.name}
sx={{ "&:last-child td, &:last-child th": { border: 0 } }} sx={{ "&:last-child td, &:last-child th": { border: 0 } }}
hover
onDoubleClick={() => openDevicePage(row)}
> >
<TableCell>{row.name}</TableCell> <TableCell>{row.name}</TableCell>
<TableCell> <TableCell>
{row.enabled ? ( <BoolText val={row.enabled} positive="YES" negative="NO" />
<span style={{ color: "green" }}>YES</span>
) : (
<span style={{ color: "red" }}>NO</span>
)}
</TableCell> </TableCell>
<TableCell>{row.priority}</TableCell> <TableCell>{row.priority}</TableCell>
<TableCell>{row.consumption}</TableCell> <TableCell>{row.consumption}</TableCell>
<TableCell>TODO</TableCell> <TableCell>
<BoolText
val={p.status.get(row.id)!.on}
positive="ON"
negative="OFF"
/>{" "}
for <TimeWidget diff time={p.status.get(row.id)!.for} />
</TableCell>
<TableCell>
<RelayForcedState
relay={row}
state={p.status.get(row.id)!}
onUpdated={p.onReload}
/>
</TableCell>
<TableCell>
<Tooltip title="Copy legacy api status">
<CopyToClipboard
content={
ServerApi.Config.unsecure_origin +
`/relay/${row.id}/legacy_state`
}
>
<IconButton>
<LinkIcon />
</IconButton>
</CopyToClipboard>
</Tooltip>
</TableCell>
</TableRow> </TableRow>
))} ))}
</TableBody> </TableBody>

View File

@@ -1,3 +1,4 @@
import { SemVer } from "semver";
import { LenConstraint } from "../api/ServerApi"; import { LenConstraint } from "../api/ServerApi";
/** /**
@@ -6,3 +7,16 @@ import { LenConstraint } from "../api/ServerApi";
export function lenValid(s: string, c: LenConstraint): boolean { export function lenValid(s: string, c: LenConstraint): boolean {
return s.length >= c.min && s.length <= c.max; return s.length >= c.min && s.length <= c.max;
} }
/**
* Check out whether a given version number respect semantics requirements or not
*/
export function checkVersion(v: string): boolean {
try {
new SemVer(v, { loose: false });
return true;
} catch (e) {
console.error(e);
return false;
}
}

View File

@@ -0,0 +1,11 @@
export function BoolText(p: {
val: boolean;
positive: string;
negative: string;
}): React.ReactElement {
return p.val ? (
<span style={{ color: "green" }}>{p.positive}</span>
) : (
<span style={{ color: "red" }}>{p.negative}</span>
);
}

View File

@@ -0,0 +1,30 @@
import { ButtonBase } from "@mui/material";
import { PropsWithChildren } from "react";
import { useSnackbar } from "../hooks/context_providers/SnackbarProvider";
export function CopyToClipboard(
p: PropsWithChildren<{ content: string }>
): React.ReactElement {
const snackbar = useSnackbar();
const copy = () => {
navigator.clipboard.writeText(p.content);
snackbar(`${p.content} copied to clipboard.`);
};
return (
<ButtonBase
onClick={copy}
style={{
display: "inline-block",
alignItems: "unset",
textAlign: "unset",
position: "relative",
padding: "0px",
}}
disableRipple
>
{p.children}
</ButtonBase>
);
}

View File

@@ -0,0 +1,79 @@
import { MenuItem, Select, SelectChangeEvent } from "@mui/material";
import { DeviceRelay } from "../api/DeviceApi";
import { RelayApi, RelayStatus, SetRelayForcedState } from "../api/RelayApi";
import { TimeWidget } from "./TimeWidget";
import { useLoadingMessage } from "../hooks/context_providers/LoadingMessageProvider";
import { useAlert } from "../hooks/context_providers/AlertDialogProvider";
import { useSnackbar } from "../hooks/context_providers/SnackbarProvider";
import React from "react";
import { SelectForcedStateDurationDialog } from "../dialogs/SelectForcedStateDurationDialog";
export function RelayForcedState(p: {
relay: DeviceRelay;
state: RelayStatus;
onUpdated: () => void;
}): React.ReactElement {
const loadingMessage = useLoadingMessage();
const alert = useAlert();
const snackbar = useSnackbar();
const [futureStateType, setFutureStateType] = React.useState<
string | undefined
>();
const handleChange = (event: SelectChangeEvent) => {
if (event.target.value == "None") {
submitChange({ type: "None" });
} else {
setFutureStateType(event.target.value);
}
};
const submitChange = async (state: SetRelayForcedState) => {
try {
loadingMessage.show("Setting forced state...");
await RelayApi.SetForcedState(p.relay, state);
p.onUpdated();
snackbar("Forced state successfully updated!");
} catch (e) {
console.error(`Failed to set relay forced state! ${e}`);
alert(`Failed to set loading state for relay! ${e}`);
} finally {
loadingMessage.hide();
}
};
return (
<>
<Select
value={p.state.forced_state.type}
onChange={handleChange}
size="small"
variant="standard"
>
<MenuItem value={"None"}>None</MenuItem>
<MenuItem value={"Off"}>Off</MenuItem>
<MenuItem value={"On"}>On</MenuItem>
</Select>
{p.state.forced_state.type !== "None" && (
<>
<TimeWidget future time={p.state.forced_state.until} /> left
</>
)}
{futureStateType !== undefined && (
<SelectForcedStateDurationDialog
{...p}
forcedState={futureStateType}
onCancel={() => setFutureStateType(undefined)}
onSubmit={(d) =>
submitChange({
type: futureStateType as any,
for_secs: d,
})
}
/>
)}
</>
);
}

View File

@@ -1,13 +1,23 @@
import { mdiChip, mdiElectricSwitch, mdiHome, mdiNewBox } from "@mdi/js"; import {
mdiChip,
mdiCog,
mdiElectricSwitch,
mdiHome,
mdiMonitorArrowDown,
mdiNewBox,
mdiNotebookMultiple,
} from "@mdi/js";
import Icon from "@mdi/react"; import Icon from "@mdi/react";
import { import {
List, List,
ListItemButton, ListItemButton,
ListItemIcon, ListItemIcon,
ListItemText, ListItemText,
Typography,
} from "@mui/material"; } from "@mui/material";
import { useLocation } from "react-router-dom"; import { useLocation } from "react-router-dom";
import { RouterLink } from "./RouterLink"; import { RouterLink } from "./RouterLink";
import { ServerApi } from "../api/ServerApi";
export function SolarEnergyNavList(): React.ReactElement { export function SolarEnergyNavList(): React.ReactElement {
return ( return (
@@ -35,6 +45,28 @@ export function SolarEnergyNavList(): React.ReactElement {
uri="/relays" uri="/relays"
icon={<Icon path={mdiElectricSwitch} size={1} />} icon={<Icon path={mdiElectricSwitch} size={1} />}
/> />
<NavLink
label="OTA"
uri="/ota"
icon={<Icon path={mdiMonitorArrowDown} size={1} />}
/>
<NavLink
label="Logging"
uri="/logs"
icon={<Icon path={mdiNotebookMultiple} size={1} />}
/>
<NavLink
label="Management"
uri="/management"
icon={<Icon path={mdiCog} size={1} />}
/>
<Typography
variant="caption"
component="div"
style={{ textAlign: "center", width: "100%", marginTop: "30px" }}
>
Version {ServerApi.Config.backend_version}
</Typography>
</List> </List>
); );
} }

View File

@@ -4,20 +4,28 @@ import React, { PropsWithChildren } from "react";
export function SolarEnergyRouteContainer( export function SolarEnergyRouteContainer(
p: { p: {
label: string; label: string;
homeWidget?: boolean;
actions?: React.ReactElement; actions?: React.ReactElement;
} & PropsWithChildren } & PropsWithChildren
): React.ReactElement { ): React.ReactElement {
return ( return (
<div style={{ margin: "50px" }}> <div
style={{
margin: p.homeWidget ? "0px" : "50px",
flex: 1,
maxWidth: "1300px",
}}
>
<div <div
style={{ style={{
display: "flex", display: "flex",
justifyContent: "space-between", justifyContent: "space-between",
alignItems: "center", alignItems: "center",
marginBottom: "20px", marginBottom: "20px",
flex: 1,
}} }}
> >
<Typography variant="h4">{p.label}</Typography> <Typography variant={p.homeWidget ? "h6" : "h4"}>{p.label}</Typography>
{p.actions ?? <></>} {p.actions ?? <></>}
</div> </div>

View File

@@ -11,24 +11,25 @@ import { areaElementClasses } from "@mui/x-charts/LineChart";
export type StatCardProps = { export type StatCardProps = {
title: string; title: string;
value: string; value: string;
interval: string; interval?: string;
trend: "up" | "down" | "neutral"; trend?: "up" | "down" | "neutral";
data: number[]; data?: number[];
}; };
function getDaysInMonth(month: number, year: number) { function last24Hours(): string[] {
const date = new Date(year, month, 0); let res: Array<string> = [];
const monthName = date.toLocaleDateString("en-US", {
month: "short", for (let index = 0; index < 3600 * 24; index += 60 * 10) {
}); const date = new Date();
const daysInMonth = date.getDate(); date.setTime(date.getTime() - index * 1000);
const days = []; res.push(date.getHours() + "h" + date.getMinutes());
let i = 1;
while (days.length < daysInMonth) {
days.push(`${monthName} ${i}`);
i += 1;
} }
return days;
res.reverse();
console.log(res);
return res;
} }
function AreaGradient({ color, id }: { color: string; id: string }) { function AreaGradient({ color, id }: { color: string; id: string }) {
@@ -50,7 +51,6 @@ export default function StatCard({
data, data,
}: StatCardProps) { }: StatCardProps) {
const theme = useTheme(); const theme = useTheme();
const daysInWeek = getDaysInMonth(4, 2024);
const trendColors = { const trendColors = {
up: up:
@@ -73,8 +73,8 @@ export default function StatCard({
neutral: "default" as const, neutral: "default" as const,
}; };
const color = labelColors[trend]; const color = labelColors[trend ?? "neutral"];
const chartColor = trendColors[trend]; const chartColor = trendColors[trend ?? "neutral"];
const trendValues = { up: "+25%", down: "-25%", neutral: "+5%" }; const trendValues = { up: "+25%", down: "-25%", neutral: "+5%" };
return ( return (
@@ -95,31 +95,38 @@ export default function StatCard({
<Typography variant="h4" component="p"> <Typography variant="h4" component="p">
{value} {value}
</Typography> </Typography>
<Chip size="small" color={color} label={trendValues[trend]} /> {trend && (
<Chip size="small" color={color} label={trendValues[trend]} />
)}
</Stack> </Stack>
<Typography variant="caption" sx={{ color: "text.secondary" }}> <Typography variant="caption" sx={{ color: "text.secondary" }}>
{interval} {interval}
</Typography> </Typography>
</Stack> </Stack>
<Box sx={{ width: "100%", height: 50 }}> <Box sx={{ width: "100%", height: 100 }}>
<SparkLineChart {data && interval && (
colors={[chartColor]} <SparkLineChart
data={data} color={chartColor}
area data={data}
showHighlight area
showTooltip showHighlight
xAxis={{ showTooltip
scaleType: "band", xAxis={{
data: daysInWeek, // Use the correct property 'data' for xAxis scaleType: "band",
}} data: last24Hours(),
sx={{ }}
[`& .${areaElementClasses.root}`]: { sx={{
fill: `url(#area-gradient-${value})`, [`& .${areaElementClasses.root}`]: {
}, fill: `url(#area-gradient-${value})`,
}} },
> }}
<AreaGradient color={chartColor} id={`area-gradient-${value}`} /> >
</SparkLineChart> <AreaGradient
color={chartColor}
id={`area-gradient-${value}`}
/>
</SparkLineChart>
)}
</Box> </Box>
</Stack> </Stack>
</CardContent> </CardContent>

View File

@@ -1,11 +1,11 @@
import { Tooltip } from "@mui/material"; import { Tooltip } from "@mui/material";
import date from "date-and-time"; import { format } from "date-and-time";
import { time } from "../utils/DateUtils"; import { time } from "../utils/DateUtils";
export function formatDate(time: number): string { export function formatDate(time: number): string {
const t = new Date(); const t = new Date();
t.setTime(1000 * time); t.setTime(1000 * time);
return date.format(t, "DD/MM/YYYY HH:mm:ss"); return format(t, "DD/MM/YYYY HH:mm:ss");
} }
export function timeDiff(a: number, b: number): string { export function timeDiff(a: number, b: number): string {
@@ -21,7 +21,7 @@ export function timeDiff(a: number, b: number): string {
diff = Math.floor(diff / 60); diff = Math.floor(diff / 60);
if (diff === 1) return "1 minute"; if (diff === 1) return "1 minute";
if (diff < 24) { if (diff < 60) {
return `${diff} minutes`; return `${diff} minutes`;
} }
@@ -51,18 +51,24 @@ export function timeDiff(a: number, b: number): string {
return `${diffYears} years`; return `${diffYears} years`;
} }
export function timeDiffFromNow(t: number): string { export function timeDiffFromNow(t: number, future?: boolean): string {
return timeDiff(t, time()); return future ? timeDiff(time(), t) : timeDiff(t, time());
} }
export function TimeWidget(p: { export function TimeWidget(p: {
time?: number; time?: number;
diff?: boolean; diff?: boolean;
future?: boolean;
}): React.ReactElement { }): React.ReactElement {
if (!p.time) return <></>; if (!p.time) return <></>;
return ( return (
<Tooltip title={formatDate(p.time)} arrow> <Tooltip
<span>{p.diff ? timeDiff(0, p.time) : timeDiffFromNow(p.time)}</span> title={formatDate(p.diff ? new Date().getTime() / 1000 - p.time : p.time)}
arrow
>
<span>
{p.diff ? timeDiff(0, p.time) : timeDiffFromNow(p.time, p.future)}
</span>
</Tooltip> </Tooltip>
); );
} }

View File

@@ -1,6 +1,5 @@
{ {
"compilerOptions": { "compilerOptions": {
"composite": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo", "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.app.tsbuildinfo",
"target": "ES2020", "target": "ES2020",
"useDefineForClassFields": true, "useDefineForClassFields": true,
@@ -11,7 +10,6 @@
/* Bundler mode */ /* Bundler mode */
"moduleResolution": "bundler", "moduleResolution": "bundler",
"allowImportingTsExtensions": true, "allowImportingTsExtensions": true,
"resolveJsonModule": true,
"isolatedModules": true, "isolatedModules": true,
"moduleDetection": "force", "moduleDetection": "force",
"noEmit": true, "noEmit": true,
@@ -21,7 +19,8 @@
"strict": true, "strict": true,
"noUnusedLocals": true, "noUnusedLocals": true,
"noUnusedParameters": true, "noUnusedParameters": true,
"noFallthroughCasesInSwitch": true "noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
}, },
"include": ["src"] "include": ["src"]
} }

View File

@@ -1,11 +1,7 @@
{ {
"files": [], "files": [],
"references": [ "references": [
{ { "path": "./tsconfig.app.json" },
"path": "./tsconfig.app.json" { "path": "./tsconfig.node.json" }
},
{
"path": "./tsconfig.node.json"
}
] ]
} }

View File

@@ -1,13 +1,24 @@
{ {
"compilerOptions": { "compilerOptions": {
"composite": true,
"tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo", "tsBuildInfoFile": "./node_modules/.tmp/tsconfig.node.tsbuildinfo",
"skipLibCheck": true, "target": "ES2022",
"lib": ["ES2023"],
"module": "ESNext", "module": "ESNext",
"skipLibCheck": true,
/* Bundler mode */
"moduleResolution": "bundler", "moduleResolution": "bundler",
"allowSyntheticDefaultImports": true, "allowImportingTsExtensions": true,
"isolatedModules": true,
"moduleDetection": "force",
"noEmit": true,
/* Linting */
"strict": true, "strict": true,
"noEmit": true "noUnusedLocals": true,
"noUnusedParameters": true,
"noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true
}, },
"include": ["vite.config.ts"] "include": ["vite.config.ts"]
} }

View File

@@ -1,7 +1,7 @@
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react' import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/ // https://vite.dev/config/
export default defineConfig({ export default defineConfig({
plugins: [react()], plugins: [react()],
}) })

File diff suppressed because it is too large Load Diff

View File

@@ -1,12 +1,12 @@
[package] [package]
name = "custom_consumption" name = "custom_consumption"
version = "0.1.0" version = "0.1.0"
edition = "2021" edition = "2024"
[dependencies] [dependencies]
env_logger = "0.11.5" env_logger = "0.11.8"
log = "0.4.22" log = "0.4.28"
clap = { version = "4.5.18", features = ["derive", "env"] } clap = { version = "4.5.53", features = ["derive", "env"] }
egui = "0.28.1" egui = "0.33.2"
eframe = "0.28.1" eframe = "0.32.3"
lazy_static = "1.5.0" lazy_static = "1.5.0"

View File

@@ -1,7 +1,6 @@
use std::time::{SystemTime, UNIX_EPOCH}; use std::time::{SystemTime, UNIX_EPOCH};
/// Get the current time since epoch /// Get the current time since epoch
pub fn time_millis() -> u128 { pub fn time_millis() -> u128 {
SystemTime::now() SystemTime::now()
.duration_since(UNIX_EPOCH) .duration_since(UNIX_EPOCH)

Some files were not shown because too many files have changed in this diff Show More