The Kitchen Hardware Interface provides tools for controlling and monitoring virtual kitchen equipment in TomatoPy.
from tomatopy import KitchenHardware
# Initialize kitchen hardware
hardware = KitchenHardware()
# Initialize specific equipment
oven = hardware.get_oven()
stove = hardware.get_stove()
blender = hardware.get_blender()
# Control oven
oven.set_temperature(180) # Celsius
oven.set_mode("bake")
oven.set_timer("30m")
# Control stove
stove.set_burner(1, temperature=100) # Celsius
stove.set_burner(2, temperature=200)
# Control blender
blender.set_speed("high")
blender.set_duration("1m")
# Configure advanced oven settings
oven.configure(
temperature=180,
mode="convection",
humidity=0.65,
fan_speed="high",
steam_injection=True,
heat_zones={
"top": 190,
"bottom": 170,
"rear": 180
}
)
# Configure advanced stove settings
stove.configure(
burners={
1: {"temperature": 100, "size": "small"},
2: {"temperature": 200, "size": "large"},
3: {"temperature": 150, "size": "medium"},
4: {"temperature": 180, "size": "medium"}
},
griddle_temperature=200,
ventilation="high"
)
# Configure advanced blender settings
blender.configure(
speed="high",
duration="1m",
pulse_pattern="intermittent",
container_size="1.5L",
blade_type="multi-purpose"
)
# Monitor equipment status
print(f"Oven temperature: {oven.get_temperature()}°C")
print(f"Stove burner 1: {stove.get_burner_status(1)}")
print(f"Blender speed: {blender.get_speed()}")
# Set up comprehensive monitoring
with hardware.monitor() as monitor:
# Monitor multiple parameters
monitor.track_temperature(oven)
monitor.track_power_usage(stove)
monitor.track_vibration(blender)
# Get monitoring data
data = monitor.get_data()
print(f"Temperature history: {data.temperature_history}")
print(f"Power usage: {data.power_usage}")
print(f"Vibration levels: {data.vibration_levels}")
# Perform safety checks
if hardware.check_safety():
# Proceed with operation
oven.start()
else:
print("Safety check failed")
# Set up safety monitoring
hardware.set_safety_monitoring(
temperature_limits={
"max": 300, # Celsius
"min": 50
},
power_limits={
"max": 5000, # Watts
"min": 0
},
ventilation_required=True,
emergency_shutdown=True
)
# Check equipment status
status = hardware.check_status()
# Perform basic maintenance
if status.needs_cleaning:
hardware.clean_equipment()
if status.needs_calibration:
hardware.calibrate_equipment()
# Schedule maintenance
hardware.schedule_maintenance(
oven,
tasks=["clean", "calibrate", "inspect"],
frequency="weekly"
)
# Get maintenance history
history = hardware.get_maintenance_history()
print(f"Last cleaning: {history.last_cleaning}")
print(f"Last calibration: {history.last_calibration}")
try:
# Attempt invalid temperature
oven.set_temperature(1000) # Too hot!
except TemperatureError as e:
print(f"Error: {e}") # "Temperature exceeds safe range"
try:
# Attempt invalid operation
blender.set_speed("invalid_speed")
except OperationError as e:
print(f"Error: {e}") # "Invalid speed setting"
Always Check Equipment Status
# Check status before use
if hardware.check_status().is_ready:
# Proceed with operation
oven.start()
else:
print("Equipment not ready")
Monitor Temperature
# Monitor temperature during operation
with hardware.temperature_monitor() as monitor:
oven.start()
if monitor.get_max() > safety_threshold:
print("Warning: Temperature too high")
Regular Maintenance
# Schedule regular maintenance
hardware.schedule_maintenance(
equipment,
tasks=["clean", "calibrate"],
frequency="daily"
)
KitchenHardware
: Main hardware control class
Oven
: Oven control class
Stove
: Stove control class
Blender
: Blender control class
Monitor
: Equipment monitoring class
Maintenance
: Maintenance management class
__init__()
get_oven()
get_stove()
get_blender()
check_safety()
check_status()
monitor()
schedule_maintenance()
get_maintenance_history()
set_safety_monitoring()
API Reference - Explore the full API
Tutorials - Learn advanced techniques
Best Practices - Learn best practices