Handle GET requests
(self)
| 42 | """HTTP request handler supporting multiple endpoints""" |
| 43 | |
| 44 | def do_GET(self): |
| 45 | """Handle GET requests""" |
| 46 | parsed_path = urlparse(self.path) |
| 47 | path = parsed_path.path |
| 48 | |
| 49 | # Route to different handlers based on path |
| 50 | if path == '/api/status': |
| 51 | self.handle_status() |
| 52 | elif path == '/api/temperature': |
| 53 | self.handle_temperature() |
| 54 | elif path == '/api/humidity': |
| 55 | self.handle_humidity() |
| 56 | elif path == '/api/read': |
| 57 | self.handle_read() |
| 58 | elif path == '/api/health': |
| 59 | self.handle_health_detailed() |
| 60 | elif path.startswith('/api/states/'): |
| 61 | self.handle_home_assistant_state(path) |
| 62 | elif path == '/api/jobs/next': |
| 63 | self.handle_jobs_next() |
| 64 | elif path == '/api/v1/query': |
| 65 | self.handle_prometheus_query(parsed_path.query) |
| 66 | elif path.startswith('/metrics/'): |
| 67 | self.handle_metrics() |
| 68 | elif path == '/health': |
| 69 | self.handle_health() |
| 70 | elif path == '/': |
| 71 | self.handle_root() |
| 72 | else: |
| 73 | self.send_error(404, "Not Found") |
| 74 | |
| 75 | def do_POST(self): |
| 76 | """Handle POST requests""" |
nothing calls this directly
no test coverage detected