Respond to /api/read with multiple sensor values
(self)
| 143 | self.send_json_response(response_data) |
| 144 | |
| 145 | def handle_read(self): |
| 146 | """Respond to /api/read with multiple sensor values""" |
| 147 | response_data = { |
| 148 | "temp": round(23.0 + random.uniform(-2, 2), 1), |
| 149 | "humidity": round(52 + random.uniform(-8, 8), 1), |
| 150 | "pressure": round(1013.25 + random.uniform(-5, 5), 2), |
| 151 | "timestamp": datetime.now().isoformat() |
| 152 | } |
| 153 | self.send_json_response(response_data) |
| 154 | |
| 155 | def handle_health(self): |
| 156 | """Respond to /health with simple health check""" |
no test coverage detected