Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
co2ampel2
Web
Commits
1a5672d3
Commit
1a5672d3
authored
Jun 26, 2025
by
Patrick Ade
Browse files
Refactor RoomDataRangeResponse to use SensorData schema for improved data structure
parent
12bd77d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
backend/app/schemas/sensor.py
View file @
1a5672d3
...
...
@@ -2,15 +2,24 @@ from ninja import Schema
from
typing
import
List
,
Dict
,
Optional
class
RoomDataPoint
(
Schema
):
time
:
str
field
:
str
value
:
float
from
datetime
import
datetime
class
SensorData
(
Schema
):
co2
:
int
humidity
:
float
temperature
:
float
class
RoomDataRangeResponse
(
Schema
):
room
:
str
data
:
Dict
[
str
,
Dict
[
str
,
float
]]
data
:
Dict
[
datetime
,
SensorData
]
class
RoomDataPoint
(
Schema
):
time
:
str
field
:
str
value
:
float
class
GetRoomsResponse
(
Schema
):
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment