MCPcopy Create free account
hub / github.com/bdring/FluidNC / handle_status

Method handle_status

examples/http_command/http_command_server.py:116–125  ·  view source on GitHub ↗

Respond to /api/status with temperature and humidity

(self)

Source from the content-addressed store, hash-verified

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"""

Callers 1

do_GETMethod · 0.95

Calls 1

send_json_responseMethod · 0.95

Tested by

no test coverage detected