Kitchen Hardware Interface
The Kitchen Hardware Interface provides tools for controlling and monitoring virtual kitchen equipment in TomatoPy.
Basic Equipment Control
Initializing Equipment
from tomatopy import KitchenHardware
# Initialize kitchen hardware
hardware = KitchenHardware()
# Initialize specific equipment
oven = hardware.get_oven()
stove = hardware.get_stove()
blender = hardware.get_blender()
Basic Equipment Control
# 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")
Advanced Equipment Control
Oven Control
# 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
}
)
Stove Control
# 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"
)
Blender Control
# Configure advanced blender settings
blender.configure(
speed="high",
duration="1m",
pulse_pattern="intermittent",
container_size="1.5L",
blade_type="multi-purpose"
)
Equipment Monitoring
Basic Monitoring
# 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()}")
Advanced Monitoring
# 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}")
Safety Features
Basic Safety Checks
# Perform safety checks
if hardware.check_safety():
# Proceed with operation
oven.start()
else:
print("Safety check failed")
Advanced Safety Monitoring
# 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
)
Equipment Maintenance
Basic Maintenance
# Check equipment status
status = hardware.check_status()
# Perform basic maintenance
if status.needs_cleaning:
hardware.clean_equipment()
if status.needs_calibration:
hardware.calibrate_equipment()
Advanced Maintenance
# 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}")
Error Handling
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"
Best Practices
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" )
API Reference
Classes
KitchenHardware
: Main hardware control classOven
: Oven control classStove
: Stove control classBlender
: Blender control classMonitor
: Equipment monitoring classMaintenance
: Maintenance management class
Methods
KitchenHardware Class
__init__()
get_oven()
get_stove()
get_blender()
check_safety()
check_status()
monitor()
schedule_maintenance()
get_maintenance_history()
set_safety_monitoring()
Next Steps
API Reference - Explore the full API
Tutorials - Learn advanced techniques
Best Practices - Learn best practices
Last updated
Was this helpful?