Respond to /api/status with temperature and humidity
(self)
| 114 | self.send_error(404, "Not Found") |
| 115 | |
| 116 | def handle_status(self): |
| 117 | """Respond to /api/status with temperature and humidity""" |
| 118 | response_data = { |
| 119 | "status": "ok", |
| 120 | "timestamp": datetime.now().isoformat(), |
| 121 | "temperature": round(20.5 + random.uniform(-2, 2), 1), |
| 122 | "humidity": round(50 + random.uniform(-10, 10), 1), |
| 123 | "uptime_seconds": 12345 |
| 124 | } |
| 125 | self.send_json_response(response_data) |
| 126 | |
| 127 | def handle_temperature(self): |
| 128 | """Respond to /api/temperature with just temperature""" |
no test coverage detected