Compare commits

...

2 Commits

Author SHA1 Message Date
Ninluc 68250e8069 IDC
Build, push image, and notify Watchtower / build-image (push) Successful in 51s
Build, push image, and notify Watchtower / notify (push) Successful in 12s
2026-08-23 18:30:00 +02:00
Ninluc fe31ac978a Dissociate DEBUG variables 2026-08-23 17:48:04 +02:00
4 changed files with 10 additions and 7 deletions
+5 -4
View File
@@ -5,7 +5,7 @@ import shared.config as config
class DishSafetyResult(BaseModel): class DishSafetyResult(BaseModel):
visible_objects: list[str] = Field( visible_objects: list[str] = Field(
description="List EVERY distinct item visible in the frame (e.g., ['ceramic bowl', 'rice', 'metal spoon handle', 'stew'])." description="List EVERY distinct item visible in the frame, one item per list element (e.g., ['ceramic bowl', 'rice', 'metal spoon handle', 'stew'])."
) )
is_safe: bool = Field( is_safe: bool = Field(
description="Is the microwave dish safe to microwave? True if safe, False if unsafe." description="Is the microwave dish safe to microwave? True if safe, False if unsafe."
@@ -22,9 +22,9 @@ def check_dish_safety(image_path: str) -> dict:
"You are an expert microwave safety quality inspector analyzing a top-down camera frame.\n\n" "You are an expert microwave safety quality inspector analyzing a top-down camera frame.\n\n"
"INSPECTION STEPS:\n" "INSPECTION STEPS:\n"
"Describe what you see in the image, identify any viewable hazards, and determine if the dish is safe to microwave.\n" "Describe what you see in the image, identify any viewable hazards, and determine if the dish is safe to microwave.\n"
"Alert only if the cooking of the dish **will cause damage** to the microwave or the dish itself.\n" "Alert only if the cooking of the dish **will cause damage** to the microwave or the dish itself, like metallic objects.\n\n"
"NOTES:\n" "NOTES:\n"
"The camera focus is wrongly setup, so the image may be blurry. Please do not take the blurriness or lack of view into a hazardn" "The camera focus is wrongly setup, so the image may be blurry. Please do not take the blurriness or lack of view into a hazard"
) )
response_raw = generate( response_raw = generate(
@@ -33,7 +33,8 @@ def check_dish_safety(image_path: str) -> dict:
output_format=DishSafetyResult, output_format=DishSafetyResult,
should_think=False, should_think=False,
) )
print(f"[Debug] Raw response from AI generator: {response_raw}") if config.DEBUG_MESSAGES:
print(f"[Debug] Raw response from AI generator: {response_raw}")
if isinstance(response_raw, str): if isinstance(response_raw, str):
try: try:
+1 -1
View File
@@ -689,7 +689,7 @@ async def request_cloud_cooking_plan(microwave_id, sensors_data):
print(f"[{microwave_id}] Cloud Plan Received! Starting microwave: {c_time}s @ {c_power}W") print(f"[{microwave_id}] Cloud Plan Received! Starting microwave: {c_time}s @ {c_power}W")
microwave_states[microwave_id].set_state(MicrowaveState.COOKING) microwave_states[microwave_id].set_state(MicrowaveState.COOKING)
if config.DEBUG: if config.DEBUG_SHORTER_COOKING_PLAN:
c_time = 20 # Set to 20s for debug c_time = 20 # Set to 20s for debug
c_temp = 50 # Set to 50°C for debug c_temp = 50 # Set to 50°C for debug
+2
View File
@@ -1,7 +1,9 @@
# Debugging and others # Debugging and others
DEBUG=True DEBUG=True
DEBUG_MESSAGES=True
DEBUG_DANGEROUS_AREA=False DEBUG_DANGEROUS_AREA=False
DEBUG_TEMPERATURE_ALERT=False DEBUG_TEMPERATURE_ALERT=False
DEBUG_SHORTER_COOKING_PLAN=True
# Technitian Web Server # Technitian Web Server
TECHNICIAN_WEB_SERVER_HOST = "192.168.50.1" TECHNICIAN_WEB_SERVER_HOST = "192.168.50.1"
+2 -2
View File
@@ -1,6 +1,6 @@
from shared.config import DEBUG from shared.config import DEBUG_MESSAGES
def log(message): def log(message):
"""Log a message to the console if DEBUG is enabled.""" """Log a message to the console if DEBUG is enabled."""
if DEBUG: if DEBUG_MESSAGES:
print(f"\n{message}") print(f"\n{message}")