def node_health_to_color(health): s = uavcan.protocol.NodeStatus() return { s.HEALTH_WARNING: Qt.yellow, s.HEALTH_ERROR: Qt.magenta, s.HEALTH_CRITICAL: Qt.red, }.get(health)