ERROR_MESSAGES = { "IP_ADDRESS": "IP Address not set", "no_error": "None", 1:"Error: Front bumper stuck", 2:"Error: Wheel stuck", 3:"Error: Side brush", 4:"Error: Rolling brush bar stuck", 5:"Error: Device trapped", 6:"Error: Device trapped", 7:"Error: Wheel suspended", 8:"Error: Low battery", 9:"Error: Magnetic boundary", 12:"Error: Right wall sensor", 13:"Error: Device tilted", 14:"Error: Insert dust collector", 17:"Error: Restricted area detected", 18:"Error: Laser cover stuck", 19:"Error: Laser sesor stuck", 20:"Error: Laser sensor blocked", 21:"Error: Base blocked", "S1":"Error: Battery", "S2":"Error: Wheel Module", "S3":"Error: Side Brush", "S4":"Error: Suction Fan", "S5":"Error: Rolling Brush", "S8":"Error: Path Tracking Sensor", "Wheel_stuck":"Error: Wheel stuck", "R_brush_stuck":"Error: Rolling brush stuck", "Crash_bar_stuck":"Error: Front bumper stuck", "sensor_dirty":"Error: Sensor dirty", "N_enough_pow":"Error: Low battery", "Stuck_5_min":"Error: Device trapped", "Fan_stuck":"Error: Fan stuck", "S_brush_stuck":"Error: Side brush stuck", } def getErrorMessage(code): return ERROR_MESSAGES.get(code, code)